Last modified: 2011-05-05 13:35:55 UTC
SRF Version 1.5.3 - the timeline format ignores the timelineposition parameter, and always centres the timeline view on the current date. Using eventline format the parameter works fine. Traced the problem to some recent refactoring performed in SRF_Timeline.php. The getEventsHTML function uses a local array variable '$positions' to work out where to centre the view, but this isn't passed by reference to the new handlePropertyValue function, which thus uses its own local scope $positions array. Fixed the problem by adding an extra reference arg &$positions to the handlePropertyValue function: protected function handlePropertyValue( SMWDataValue $object, $outputmode, SMWPrintRequest $pr, $first_col, &$hastitle, &$hastime, $first_value, $isEventline, &$curmeta, &$curdata, &$positions, $date_value, &$output ) And passing the local $positions array to it in getEventsHTML: $event = $this->handlePropertyValue( $object, $outputmode, $pr, $first_col, $hastitle, $hastime, $first_value, $isEventline, $curmeta, $curdata, $positions, $date_value, $output );
Thanks for this; Just committed your fix: https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Special:Code/MediaWiki/87496 The timeline code is just really bad though :<0