Index: trunk/extensions/MetricsReporting/ApiAnalyticsBase.php |
— | — | @@ -147,11 +147,11 @@ |
148 | 148 | |
149 | 149 | $fields = array_map( array( $this, 'getColumnName' ), $query['fields'] ); |
150 | 150 | |
151 | | - $storageKey = $titleFields[0]; |
| 151 | + $storageKey = count( $titleFields ) ? $titleFields[0] : null; |
152 | 152 | $things = array(); |
153 | 153 | // Build result set |
154 | 154 | 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 |
156 | 156 | $things[$row->$storageKey] = array(); |
157 | 157 | foreach( $titleFields as $field ) { |
158 | 158 | $things[$row->$storageKey][$field] = $row->$field; |
— | — | @@ -166,7 +166,7 @@ |
167 | 167 | |
168 | 168 | if( isset( $storageKey ) ){ |
169 | 169 | $things[$row->$storageKey]['data'][] = $item; |
170 | | - |
| 170 | + |
171 | 171 | $result->setIndexedTagName( $things[$row->$storageKey]['data'], 'd' ); |
172 | 172 | } else { |
173 | 173 | $result->addValue( array( $this->getModuleName() ), null, $item ); |