On line 128 of Timeline.class.inc is the following:

return timeline_date_conversion($this->data['events']['events'][count($this->data - 1)]['start'], 'iso8601', 'gregorian');

When run (as in selecting the timeline to start out centered on the last result) a php error will occur, with an error like this in the web server logs:

Unsupported operand types in timeline/classes/Timeline.class.inc on line 128

The count($this->data - 1) is a bug and should be something like:

return timeline_date_conversion($this->data['events']['events'][count($this->data['events']['events']) - 1]['start'], 'iso8601', 'gregorian');

I'm attaching a patch. Apply in timeline/classes with patch -p0 < Timeline.class.inc.patch

I am tempted to rework that entire routine to do some better boundary conditions checking (such as if there are any results returned at all and centering on "today" instead of the default, which is 1970, because the value for time is computed as 0).

If you want, I could do some of that and submit a patch for it...

CommentFileSizeAuthor
Timeline.class_.inc_.patch1.06 KBjcolbyk

Comments

xamanu’s picture

Thank you! I reviewed and applied your patch to the DRUPAL-6--2 branch (Commit: #259412).

Of course I'm open for patches and you are more than welcome to improve this routine!

xamanu’s picture

Status: Active » Closed (fixed)