Skip to content

event_listing does not find events spanning multiple days in future mode with whole_event #360

@ghost

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions