r91614 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91613‎ | r91614 | r91615 >
Date:22:18, 6 July 2011
Author:reedy
Status:deferred
Tags:
Comment:
Followup r91612, be a bit more explicit with the code
Modified paths:
  • /trunk/extensions/MetricsReporting/ApiAnalyticsBase.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetricsReporting/ApiAnalyticsBase.php
@@ -147,11 +147,11 @@
148148
149149 $fields = array_map( array( $this, 'getColumnName' ), $query['fields'] );
150150
151 - $storageKey = $titleFields[0];
 151+ $storageKey = count( $titleFields ) ? $titleFields[0] : null;
152152 $things = array();
153153 // Build result set
154154 foreach( $res as $row ) {
155 - if( isset($storageKey) && !isset( $things[$row->$storageKey] ) ) { // find dynamic value for each query type
 155+ if( isset( $storageKey ) && !isset( $things[$row->$storageKey] ) ) { // find dynamic value for each query type
156156 $things[$row->$storageKey] = array();
157157 foreach( $titleFields as $field ) {
158158 $things[$row->$storageKey][$field] = $row->$field;
@@ -166,7 +166,7 @@
167167
168168 if( isset( $storageKey ) ){
169169 $things[$row->$storageKey]['data'][] = $item;
170 -
 170+
171171 $result->setIndexedTagName( $things[$row->$storageKey]['data'], 'd' );
172172 } else {
173173 $result->addValue( array( $this->getModuleName() ), null, $item );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r91612handles case of no filtersnimishg22:12, 6 July 2011

Status & tagging log