r109812 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109811‎ | r109812 | r109813 >
Date:10:49, 23 January 2012
Author:maxsem
Status:ok (Comments)
Tags:
Comment:
Follow-up r108676: fix undefined variable notices
Modified paths:
  • /trunk/extensions/GeoData/ApiQueryCoordinates.php (modified) (history)
  • /trunk/extensions/GeoData/ApiQueryGeoSearch.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GeoData/ApiQueryCoordinates.php
@@ -57,7 +57,7 @@
5858 $vals['primary'] = '';
5959 }
6060 foreach( $params['prop'] as $prop ) {
61 - if ( isset( Coord::$fieldMapping[$prop] ) && isset( $row->$field ) ) {
 61+ if ( isset( Coord::$fieldMapping[$prop] ) && isset( $row->{Coord::$fieldMapping[$prop]} ) ) {
6262 $field = Coord::$fieldMapping[$prop];
6363 $vals[$prop] = $row->$field;
6464 }
Index: trunk/extensions/GeoData/ApiQueryGeoSearch.php
@@ -110,11 +110,11 @@
111111 $vals['primary'] = '';
112112 }
113113 foreach( $params['prop'] as $prop ) {
114 - if ( isset( Coord::$fieldMapping[$prop] ) && isset( $row->$field ) ) {
 114+ if ( isset( Coord::$fieldMapping[$prop] ) && isset( $row->{Coord::$fieldMapping[$prop]} ) ) {
115115 $field = Coord::$fieldMapping[$prop];
116116 $vals[$prop] = $row->$field;
117117 }
118 - }
 118+ }
119119 $fit = $result->addValue( array( 'query', $this->getModuleName() ), null, $vals );
120120 if ( !$fit ) {
121121 break;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108676Don't output stuff when it's null, i.e. no "paramname": nullmaxsem20:32, 11 January 2012

Comments

#Comment by Nikerabbit (talk | contribs)   11:09, 23 January 2012

Maybe you should pull Coord::$fieldMapping[$prop] into variable.

Status & tagging log