r91596 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91595‎ | r91596 | r91597 >
Date:20:18, 6 July 2011
Author:reedy
Status:ok
Tags:
Comment:
* (bug 29745) Fatal error in API search

Properly name objects being used
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/api/ApiQuerySearch.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -131,7 +131,7 @@
132132 correctly.
133133 * (bug 29567) mw.util.addPortletLink should only wrap link in <span> for
134134 "vectorTabs" portlets.
135 -* (bug 8556) Incorrect session failure warning on preview-on-open
 135+* (bug 8556) Incorrect session failure warning on preview-on-open
136136 namespaces (categories) when combined with $wgRawHtml.
137137 * Use content language in formatting of dates in revertpage message
138138 (rollback revert edit summary) and do not adjust for user timezone.
@@ -165,6 +165,7 @@
166166 * (bug 27595) sha1 search of list=filearchive does not work
167167 * (bug 26763) Make RSS/Atom of user contributions more visible
168168 * (bug 25133) Allow redirects also for action=parse&pageid
 169+* (bug 29745) Fatal error in API search
169170
170171 === Languages updated in 1.19 ===
171172
Index: trunk/phase3/includes/api/ApiQuerySearch.php
@@ -97,17 +97,17 @@
9898 $this->dieUsage( "{$what} search is disabled", "search-{$what}-disabled" );
9999 }
100100
101 - $result = $this->getResult();
 101+ $apiResult = $this->getResult();
102102 // Add search meta data to result
103103 if ( isset( $searchInfo['totalhits'] ) ) {
104104 $totalhits = $matches->getTotalHits();
105105 if ( $totalhits !== null ) {
106 - $result->addValue( array( 'query', 'searchinfo' ),
 106+ $apiResult->addValue( array( 'query', 'searchinfo' ),
107107 'totalhits', $totalhits );
108108 }
109109 }
110110 if ( isset( $searchInfo['suggestion'] ) && $matches->hasSuggestion() ) {
111 - $result->addValue( array( 'query', 'searchinfo' ),
 111+ $apiResult->addValue( array( 'query', 'searchinfo' ),
112112 'suggestion', $matches->getSuggestionQuery() );
113113 }
114114
@@ -116,6 +116,7 @@
117117 $titles = array();
118118 $count = 0;
119119 $result = $matches->next();
 120+
120121 while ( $result ) {
121122 if ( ++ $count > $limit ) {
122123 // We've reached the one extra which shows that there are additional items to be had. Stop here...
@@ -172,7 +173,7 @@
173174 }
174175
175176 // Add item to results and see whether it fits
176 - $fit = $result->addValue( array( 'query', $this->getModuleName() ),
 177+ $fit = $apiResult->addValue( array( 'query', $this->getModuleName() ),
177178 null, $vals );
178179 if ( !$fit ) {
179180 $this->setContinueEnumParameter( 'offset', $params['offset'] + $count - 1 );
@@ -186,7 +187,7 @@
187188 }
188189
189190 if ( is_null( $resultPageSet ) ) {
190 - $result->setIndexedTagName_internal( array(
 191+ $apiResult->setIndexedTagName_internal( array(
191192 'query', $this->getModuleName()
192193 ), 'p' );
193194 } else {

Status & tagging log