https://bugzilla.wikimedia.org/show_bug.cgi?id=28832

       Web browser: ---
             Bug #: 28832
           Summary: Timeline: timelineposition parameter doesn't work in
                    timeline mode
           Product: MediaWiki extensions
           Version: any
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: SemanticResultFormats
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


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 );

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to