michaelschutz β created an issue.
Hi again, here's more detail on this issue.
Firstly, I need to update the title/scope. It affects the display of all-day events, but it doesn't seem like the all-day event is the cause. The cause is any recurring event.
I've attached a screenshot that may demonstrate more clearly than my written descriptions.
Setup
This is happening on D9 (9.5.11 - the original install I noticed this on), D10 (10.3.3), and D11 (11.0.2 - just saw there's 11.0.3 but haven't updated to that yet) with Smart Date/Smart Date Recur 4.1.6 and Calendar View 2.1.9.
What should happen
All events, whether timed or all-day, whether one-off or recurring, should sort properly within a given day when there are multiple events on that day. All-day events should be listed first on any given day, before any timed events (which means recurring all-day events work fine even with this apparent bug, since they're always listed first anyway).
What is happening
When there is a recurring timed event, the first instance of that recurring event sorts properly with other events that fall on that date, but subsequent instances of that recurring event do not. On subsequent instances, the recurring event is always listed first on that day, even if it shouldn't be.
When the recurring event falls on a day together with an all-day event, the first instance sorts properly, but subsequent instances of the recurring event appear in the wrong order on that day. (Screenshot: on the 16th, an 11am Recurring Meeting begins. The All-Day Test 3 event appears properly before that. However, on the 23rd, I would expect the All-Day Test 4 event to be listed before the 11am Recurring Meeting.)
When the recurring event falls on a day together with other timed events, the same thing happens. (Screenshot: On the 11th, a 12pm Recurring Meeting begins. An 11am Test Event is listed before it, as it should. However, on the 25th, the 12pm Recurring Meeting is listed before the one-off 11am Event.
Possible Explanation
I know this is vague, but there seems to be some odd interaction between the start times of recurring events and one-off events within a given day.
This isn't in the screenshot, but I went back and added a second recurring event on the 16th, 23rd, and 30th, getting it to interact with the 11am Recurring Meeting. The new recurring event sorted properly with the 11am Recurring Meeting whether it was set to 9am or 3pm. Both recurring events were listed before the "All-Day Test 4" event on the 23rd, however.
Steps to Reproduce
- Add a recurring event with a start time.
- Add a one-off event on the same day as one of the instances of the recurring event that is not the first instance.
- The recurring event will be listed first on that day, even if its start time is later than the one-off event.
Thanks @matthieuscarset, Iβm away for a week so will give more detail when I get back, but just a quick clarification: the issue is not that the all-day event doesnβt repeat properly. The issue is when I have a timed repeating event, letβs say a weekly meeting at 7pm on Thursday. Then I add an all-day event on a Thursday that is not the first instance of that meeting. I would expect the all-day event to be listed first on that day, then the 7pm meeting. But the meeting will be listed first.
I hope that clarifies. Iβll see about reproducing it, screenshot, and documenting it more when I get back.
Just saw a new release for D11 - any chance we can get the MR with this patch from #15 approved and committed into a 2.1.9 release?
michaelschutz β created an issue.
removing content re: sorting
michaelschutz β created an issue.
OK just one more quick note until I have more time. On this sandbox site, with D10.2.0 and CalView 2.1.7, all-day events are not being displayed properly, as above. This only applies to all-day events and not events with start/end times within the one date; those are displayed properly.
I downgraded to CalView 2.1.6 without changing anything else on the site, and all dates display properly. Re-upgrading to 2.1.7 causes the shift to all-day events having their start times be displayed wrongly (on my site, with timezone set to UTC -8, as if it started at 16:00 the day before).
The all-day dates display properly on just a basic unformatted list of events, so I can confirm it is related to CalView calendars.
So it seems that something has changed between 2.1.6 and 2.1.7 that causes this. Once I have more time I can try to dig into the changes, but maybe Mattieu or someone else can pinpoint that much more quickly than me.
So I just updated another sandbox site to D10.2 and it's still exhibiting the same behaviour (with calendar_view 2.1.7). I just now realized that there's a hover/tooltip behaviour on the event shown on the calendar events, and it gives the details of the event - date, time, timezone.
So there's something going on with the timezone conversion. I have my site set to Pacific Time (right now that's UTC -8), and the event on the calendar is subtracting 8 hours, not from GMT, but from midnight. (Screenshot is attached showing that calendar_view thinks the Christmas Day event starts at 16:00 PST on the 24th instead of 0:00 on the 25th.
I tried it out with another random timezone, (Amsterdam, UTC +1) and the same calculation was made for that time zone, pushing the date displayed onto the 26th as well as the 25th. So that seems to confirm what I'm thinking.
That will allow me to peek into the code to look for a bug, but as I'm not at all skilled with code I don't know if I can find anything. But maybe this gives @matthieucarset or someone else the road map to find what's happening?
Thanks for the additional insight, @msac. My demo site is still on Drupal 10.1.6, so there might be a combination of things? I wish I could help narrow this down.
edited for clarity
michaelschutz β created an issue.
Just confirming that this issue exists for me in one of my sites as well, using the OpenSocial profile (v11.10.1) which requires Admin Toolbar 3.4.1. Got a WSOD after updating, and the error message was that from #5. Applying the patch in #3 fixed it.
edited to give specific error message
michaelschutz β created an issue.
I just found this bug as well. Same issue with a Name field. I wish I could help with code, but just offering a bump/plea for a patch.
Just circling back to close this loop...
I went with the super-simple option of using Twig in the field rewrite box to evaluate the start time string - i.e. {% if field_event_date_value != "12:00am" %}
Probably not the best way to do it, but with my limited time and skill, it works. :)
Thanks again.
Much appreciated mandclu. I may be out of my depth here, but I'll start there and see what I can make happen.
I don't actually want to filter the view to show only all-day events, so I'm not sure a filter would work anyway. I just want to "filter" the visibility of the "All-day" text. But if I can get a boolean for that in a calculated field, then I could use Twig to conditionally hide the Date->Start field. Thanks for pointing me in a helpful direction.
michaelschutz β created an issue.
michaelschutz β created an issue.