My url alias had started generating 1969/12/31 when I upgraded to 5.2.dev (possibly before that, wasn't tracking it very closely)
Going through the tokens module I found this section referring to a object->event_start location I think may have moved:
function event_token_values($type, $object = NULL) {
if ($type == 'node') {
// Get the event start time as a Unix timestamp
$eventstart = $object->event_start;
if (is_numeric($eventstart)) $eventstart = (int)$eventstart;
elseif (is_string($eventstart)) $eventstart = strtotime($object->event_start);
Replacing it with the below did the trick:
function event_token_values($type, $object = NULL) {
if ($type == 'node') {
// Get the event start time as a Unix timestamp
$eventarray = $object->event;
$eventstart=$eventarray['start'];
if (is_numeric($eventstart)) $eventstart = (int)$eventstart;
elseif (is_string($eventstart)) $eventstart = strtotime($eventstart);
Notice several changes
1. change initial object var called for
2. caught event in an array
3. pulled the start date out of the array
4. in the last line, strtotime now calls the $eventstart var instead of the incorrect object location.
Could probably cut out the extra array steps.
Seems to be working for me now.
Thanks
Comments
Comment #1
japerryEvent 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.