r89985 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89984‎ | r89985 | r89986 >
Date:18:07, 13 June 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
compat fix
Modified paths:
  • /trunk/extensions/SemanticResultFormats/jqPlot/SRF_jqPlotPie.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticResultFormats/jqPlot/SRF_jqPlotPie.php
@@ -119,21 +119,27 @@
120120 while ( $row = $res->getNext() ) {
121121 $name = efSRFGetNextDV( $row[0] )->getShortWikiText();
122122 $name = str_replace( "'", "\'", $name );
 123+
123124 foreach ( $row as $field ) {
124125 while ( ( $object = efSRFGetNextDV( $field ) ) !== false ) {
125126 if ( $object->isNumeric() ) { // use numeric sortkey
126 - if ( method_exists( $object, 'getValueKey' ) ) {
 127+
 128+ // getDataItem was introduced in SMW 1.6, getValueKey was deprecated in the same version.
 129+ if ( method_exists( $object, 'getDataItem' ) ) {
 130+ $nr = $object->getDataItem()->getSortKey();
 131+ } else {
127132 $nr = $object->getValueKey();
128 - } else {
129 - $nr = $object->getNumericValue();
130133 }
 134+
131135 $pie_data[] .= "['$name', $nr]";
132136 }
133137 }
134138 }
135139 }
 140+
136141 $pie_data_str = "[[" . implode( ', ', $pie_data ) . "]]";
137142 $pieID = 'pie' . self::$m_piechartnum;
 143+
138144 self::$m_piechartnum++;
139145
140146 $js_pie =<<<END