Anomie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/170093

Change subject: Correctly populate pageset in ApiQueryGeoSearchElastic
......................................................................

Correctly populate pageset in ApiQueryGeoSearchElastic

When using ApiPageSet::populateFromQueryResult(), the query must contain
all the columns returned by that instance's
ApiPageSet::getPageTableFields().

Bug: 72764
Change-Id: Ic49e2b1b2b6e1cc6dac0d710df5249cedd90a55f
---
M api/ApiQueryGeoSearchElastic.php
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GeoData 
refs/changes/93/170093/1

diff --git a/api/ApiQueryGeoSearchElastic.php b/api/ApiQueryGeoSearchElastic.php
index 5949b24..689cf31 100644
--- a/api/ApiQueryGeoSearchElastic.php
+++ b/api/ApiQueryGeoSearchElastic.php
@@ -126,7 +126,11 @@
                        }
                        $this->addWhere( array( 'page_id' => array_keys( $ids ) 
) );
                        $this->addTables( 'page' );
-                       $this->addFields( array( 'page_id', 'page_title', 
'page_namespace' ) );
+                       if ( is_null( $resultPageSet ) ) {
+                               $this->addFields( array( 'page_id', 
'page_title', 'page_namespace' ) );
+                       } else {
+                               $this->addFields( 
$resultPageSet->getPageTableFields() );
+                       }
 
                        wfProfileIn( __METHOD__ . '-sql' );
                        $res = $this->select( __METHOD__ );

-- 
To view, visit https://gerrit.wikimedia.org/r/170093
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic49e2b1b2b6e1cc6dac0d710df5249cedd90a55f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GeoData
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to