Index: trunk/extensions/MetricsReporting/ApiAnalyticsBase.php |
— | — | @@ -151,7 +151,7 @@ |
152 | 152 | $things = array(); |
153 | 153 | // Build result set |
154 | 154 | foreach( $res as $row ) { |
155 | | - if( !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 |
156 | 156 | $things[$row->$storageKey] = array(); |
157 | 157 | foreach( $titleFields as $field ) { |
158 | 158 | $things[$row->$storageKey][$field] = $row->$field; |
— | — | @@ -164,8 +164,13 @@ |
165 | 165 | $item[$field] = $row->$field; |
166 | 166 | } |
167 | 167 | |
168 | | - $things[$row->$storageKey]['data'][] = $item; |
169 | | - $result->setIndexedTagName( $things[$row->$storageKey]['data'], 'd' ); |
| 168 | + if( isset( $storageKey ) ){ |
| 169 | + $things[$row->$storageKey]['data'][] = $item; |
| 170 | + |
| 171 | + $result->setIndexedTagName( $things[$row->$storageKey]['data'], 'd' ); |
| 172 | + } else { |
| 173 | + $result->addValue( array( $this->getModuleName() ), null, $item ); |
| 174 | + } |
170 | 175 | } |
171 | 176 | |
172 | 177 | // Add data to the output |