Last modified: 2011-05-05 13:35:55 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T30832, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28832 - Timeline: timelineposition parameter doesn't work in timeline mode
Timeline: timelineposition parameter doesn't work in timeline mode
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
SemanticResultFormats (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Jeroen De Dauw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-05 09:18 UTC by Matt Voysey
Modified: 2011-05-05 13:35 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Matt Voysey 2011-05-05 09:18:32 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 );
Comment 1 Jeroen De Dauw 2011-05-05 13:35:55 UTC
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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links