When you events-enable a node, create events, then later unenable the node for events, the events remain in the events table. I don't know that this is bad, it means you can re-events-enable the node later and have them all still there. However, it creates a nasty problem (on windows at least).

If there are events in the events table for a node and the node is not currently events-enabled, the event_calendar_data function will go ahead and try to create gmtimestamps for the non-existent start and end dates of each event it finds. On windows this creates the "gmdate(): Windows does not support dates prior to midnight (00:00:00), January 1, 1970" error for each timestamp it tries to process. This does not create an error on unix, but the module is still doing a bunch of unnecessary processing for nodes that are not events-enabled.

The attached patch checks that the node being processed has event fields in it and stops the processing before trying to create timestamps if it does not.

There is still the question of whether or not events should be deleted from the events table when someone changes the status of a node type to no longer be events-enabled. That probably calls for another patch to check if events exist and do something more proactive (warn them that there are events still in the database and refuse to allow them to change the status? offer an option with a warning that all events associated with that type will be deleted?)

Even if that is done, this patch (or something similar) will be needed since this has been the behavior in the past and there may already be events in the events table that no longer are relevant.

CommentFileSizeAuthor
event.module_30.patch873 byteskarens

Comments

killes@www.drop.org’s picture

Version: 5.x-2.x-dev » 5.x-1.x-dev
Status: Active » Needs review

moving to right status.

japerry’s picture

Status: Needs review » Closed (outdated)

Event for Drupal 8 is unrelated to older versions. If an issue similar to this one exists, please open a new issue with the 8.x branch.