* (bug 29745) Fatal error in API search
authorSam Reed <reedy@users.mediawiki.org>
Wed, 6 Jul 2011 20:18:22 +0000 (20:18 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Wed, 6 Jul 2011 20:18:22 +0000 (20:18 +0000)
Properly name objects being used

RELEASE-NOTES-1.19
includes/api/ApiQuerySearch.php

index 4b09da3..c135eb7 100644 (file)
@@ -131,7 +131,7 @@ production.
   correctly.
 * (bug 29567) mw.util.addPortletLink should only wrap link in <span> for
   "vectorTabs" portlets.
-* (bug 8556) Incorrect session failure warning on preview-on-open 
+* (bug 8556) Incorrect session failure warning on preview-on-open
   namespaces (categories) when combined with $wgRawHtml.
 * Use content language in formatting of dates in revertpage message
   (rollback revert edit summary) and do not adjust for user timezone.
@@ -165,6 +165,7 @@ production.
 * (bug 27595) sha1 search of list=filearchive does not work
 * (bug 26763) Make RSS/Atom of user contributions more visible
 * (bug 25133) Allow redirects also for action=parse&pageid
+* (bug 29745) Fatal error in API search
 
 === Languages updated in 1.19 ===
 
index e5bf0d0..bd7adc2 100644 (file)
@@ -97,17 +97,17 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                        $this->dieUsage( "{$what} search is disabled", "search-{$what}-disabled" );
                }
 
-               $result = $this->getResult();
+               $apiResult = $this->getResult();
                // Add search meta data to result
                if ( isset( $searchInfo['totalhits'] ) ) {
                        $totalhits = $matches->getTotalHits();
                        if ( $totalhits !== null ) {
-                               $result->addValue( array( 'query', 'searchinfo' ),
+                               $apiResult->addValue( array( 'query', 'searchinfo' ),
                                                'totalhits', $totalhits );
                        }
                }
                if ( isset( $searchInfo['suggestion'] ) && $matches->hasSuggestion() ) {
-                       $result->addValue( array( 'query', 'searchinfo' ),
+                       $apiResult->addValue( array( 'query', 'searchinfo' ),
                                                'suggestion', $matches->getSuggestionQuery() );
                }
 
@@ -116,6 +116,7 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                $titles = array();
                $count = 0;
                $result = $matches->next();
+
                while ( $result ) {
                        if ( ++ $count > $limit ) {
                                // We've reached the one extra which shows that there are additional items to be had. Stop here...
@@ -172,7 +173,7 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                                }
 
                                // Add item to results and see whether it fits
-                               $fit = $result->addValue( array( 'query', $this->getModuleName() ),
+                               $fit = $apiResult->addValue( array( 'query', $this->getModuleName() ),
                                                null, $vals );
                                if ( !$fit ) {
                                        $this->setContinueEnumParameter( 'offset', $params['offset'] + $count - 1 );
@@ -186,7 +187,7 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                }
 
                if ( is_null( $resultPageSet ) ) {
-                       $result->setIndexedTagName_internal( array(
+                       $apiResult->setIndexedTagName_internal( array(
                                                'query', $this->getModuleName()
                                        ), 'p' );
                } else {