- Issue created by @stijnd
- 🇳🇱Netherlands johnv
I did encounter such behaviour when developing for the upcoming version 1.13.
But now, the problem is gone (for me, as maintainer).
I did receive one other issue (cannot find it back).
I expected that the error was in my development code, but now it seems it is already in v1.12.
Please try current dev version, and report back. - Status changed to Postponed: needs info
10 months ago 4:35pm 26 January 2024 - Status changed to Active
10 months ago 8:42am 27 January 2024 - 🇳🇱Netherlands johnv
When the data is saved wrongly, it must be corrected in the widget, first.
First establish/test that the widget works fine, then find out which data is wrong.
- 🇧🇪Belgium stijnd Belgium
Had another look at this one.
According to me there's a storage problem. The deltas are wrong. See attached screenshots. I can't see where's the issue in the Widget for now.
- 🇳🇱Netherlands johnv
The delta in the table is de delta for the complete field, for a 2-slots-per-day, having values 0-13 (or 1-14)
However, this field is not used in the entityfield display. Here, you only have values 0-1 for a 2-slots-per-day system.You will find some issues in the issue queue regarding sorting. Days and slots per day are now sorted, according to date and start time.
So your situation is 'works as designed.'Another thing:
Your example has an empty timeslot with a non-empty comment, that is why it is stored. You can use it for 'closed today' text, instead of the 'closed text' in field settings.
If you remove the comment, the value is not stored anymore.
In the formatter, when the first value is an 'all_day' (values 0-0), any subsequent slots are not displayed. This must still be guared in the widget. - 🇧🇪Belgium stijnd Belgium
I understand your comment regarding the delta. Weird I add a comment in the second slot and it is saved as first delta, instead of second, but I can find me in 'Works as designed'.
Digged in quite deep and I've seen this is not an easy one.What I don't understand is the empty time slot. For my use case it's necessary the "not empty comment" is stored because this generated a kind of table for the morning/afternoon (with the Plain text Formatter):
Morning / afternoon
Monday: - 13 until 17h
Tuesday: 8 until 12 -If there's another solution of doing this I'm missing out on something. Nevertheless, in the older version of the module this was possible by leaving the timeslot empty and adding a comment. I hope I'm not the only one who used this module like this :-)
- 🇳🇱Netherlands johnv
I understand, you ALWAYS want 2 slots. I must check this out.
For my testing, developing, I only use the table formatters, I am not sure if the normal formatter supports all cases, too. - 🇧🇪Belgium stijnd Belgium
Correct. This improves reading for the users in my opinion because in my case it's always morning/afternoon.
At the moment of developing the project this was not possible with the Table formatter so I decided to use the Plain text formatter with some styling.
- Status changed to Fixed
10 months ago 5:07pm 30 January 2024 - 🇳🇱Netherlands johnv
Please test new dev version.
I removed the sorting of hours. I feel they must be left to the user's responsibility.
The behaviour of PHP 8 if different then of PHP 7.
From https://www.php.net/manual/en/array.sorting.php
// "If any of these sort functions evaluates two members as equal
// then they retain their original order. Prior to PHP 8.0.0,
// their order were undefined (the sorting was not stable)."So basically, this reverts the change in 🐛 Sort order of Same day time slots is lost Fixed .
The sorting is now only done in the formatter, not when saving the data from the widget.
(Perhaps i will get follow-up complaints about the sorting of exception days in the widget.)One doubt: not sure if the comments show up correctly. It may be my own settings.
Please test and report back. If there is any problem, please reopen this issue. Automatically closed - issue fixed for 2 weeks with no activity.