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

will kirchheimer’s picture

Status: Active » Closed (duplicate)

Sure this duplicate was submitted when the site was having database connection problems. Didn't mean to add two.