When the event time zone display is set to 'site' or 'user' the following error occurs:

date_parse() expects parameter 1 to be string, array given in .../event.module on line 2729.

I investigated the module a little bit and found out that the error comes from the line 2272 in event.module
$node->event['start_exploded'] = event_explode_date($node->event['start']);
$node->event['end_exploded'] = event_explode_date($node->event['end']);

the preceding switch statement (line 2257) changes the $node->event['start'] and ..['end'] field to the site or user strat/end time, however this site/user time is already an array, that's why the date_parse() function in event_explode_data() throws an error.

A possible correction would be to replace the 2 lines mentioned above with:

if (is_array($node->event['start'])) {
$node->event['start_exploded'] = $node->event['start'];
$node->event['end_exploded'] = $node->event['end'];
} else {
$node->event['start_exploded'] = event_explode_date($node->event['start']);
$node->event['end_exploded'] = event_explode_date($node->event['end']);
}

There is no more error, but I think that's not exactly how it should be done, because $node->event['start/end'] would still contain an array. I don't know if this is wanted or not, because in the case of the timezone display being set to 'event', these fileds would contain a date string and not an array.

Hope this is helpful

Comments

japerry’s picture

Status: Active » 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.