-
-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Possibly the same as #297
Plone 5.2.8
plone.app.event 3.2.14 (pinned by this Plone version)
To reproduce:
Create an Event with whole_day selected, a start day before today, and an end day after today. e.g. for today's date of 28 July 2022 create an Event with start 01 July 2022 and end 01 August 2022. Create a Collection with criteria portal_type==Event and give it the "Event Listing" display.
Observed behavior:
This event is not displayed in future mode.
Expected behavior:
This event should be displayed in future mode.
Important note: if whole_day is unselected, I do get the expected behavior. This is the biggest indicator that there is a bug with the logic and it is not a design decision or limitation
Diagnosis:
The event machinery here is very complex, which is not surprising given the wide range of configurability offered to users in Plone. Events are searched to match date range and other criteria and then "expanded" to account for occurrences. Events without recurrences still provide IEventRecurrence and so are subject to this process and that seems to be where the culprit is. In particular it is this if/else block https://github.com/plone/plone.app.event/blob/3.2.14/plone/app/event/recurrence.py#L72. In our example above, the if statement is true because of whole_day so it assigns "event_end" as 21 July 2022 23:59:59. This is obviously wrong.