Skip to content

Long events in widget calendar causing dates to be modified #159

@stephenharris

Description

@stephenharris

As reported here: http://wordpress.org/support/topic/event-that-spans-more-than-one-day-gets-wrong-startdate

So I've identified a problem with the Event Calendar Widget. If you have enabled the option to show long events, the query from the Calendar Widget modifies the data start-date stored for the event in wp_cache.

Example: I have an event that spans 2013-10-29 to 2013-10-31. The first call to eo_get_the_occurrences_of(17091) does a database query and returns the correct date.

The next call to the same function with the same ID correctly returns the data from the cache, with the correct start_date (2013-10-29).

However, the third call (the second to the cache) returns 2013-11-01 as start-date, still for the same event with the same event id (17091).

In my template, the sidebar is called before the loop, so the Event Calendar Widget is the responsible function for these first eo_get_the_occurrences_of-queries.
If I disable the widget, the start-date never is modified and the loop displays the correct start-date. I have from my loop done several (repeatedly) calls to eo_get_the_occurrences_of to the same ID but the start-date stays the same, unmodified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions