r103233 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103232‎ | r103233 | r103234 >
Date:21:55, 15 November 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_Distributable.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_Distributable.php
@@ -161,11 +161,15 @@
162162
163163 // print all result rows
164164 while ( $row = $res->getNext() ) {
165 - $name = $row[0]->getNextDataValue()->getShortWikiText();
 165+ $dataValue = $row[0]->getNextDataValue();
166166
167 - foreach ( $row as $field ) {
168 - while ( ( /* SMWDataItem */ $dataItem = $field->getNextDataItem() ) !== false ) {
169 - $this->addNumbersForDataItem( $dataItem, $values, $name );
 167+ if ( $dataValue !== false ) {
 168+ $name = $dataValue->getShortWikiText();
 169+
 170+ foreach ( $row as $field ) {
 171+ while ( ( /* SMWDataItem */ $dataItem = $field->getNextDataItem() ) !== false ) {
 172+ $this->addNumbersForDataItem( $dataItem, $values, $name );
 173+ }
170174 }
171175 }
172176 }