r39614 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39613‎ | r39614 | r39615 >
Date:20:48, 18 August 2008
Author:catrope
Status:old
Tags:
Comment:
(bug 15228) Throw a warning instead of an error when revids= and redirects are combined. Also fixed a bug that caused warnings thrown in ApiPageSet.php to appear in an <ApiPageSet> tag rather than <query>
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiPageSet.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiPageSet.php
@@ -53,7 +53,7 @@
5454 private $mRequestedPageFields;
5555
5656 public function __construct($query, $resolveRedirects = false) {
57 - parent :: __construct($query, __CLASS__);
 57+ parent :: __construct($query, 'query');
5858
5959 $this->mAllPages = array ();
6060 $this->mTitles = array();
@@ -254,7 +254,9 @@
255255 break;
256256 case 'revids' :
257257 if($this->mResolveRedirects)
258 - $this->dieUsage('revids may not be used with redirect resolution', 'params');
 258+ $this->setWarning('Redirect resolution cannot be used together with the revids= parameter. '.
 259+ 'Any redirects the revids= point to have not been resolved.');
 260+ $this->mResolveRedirects = false;
259261 $this->initFromRevIDs($revids);
260262 break;
261263 default :
@@ -475,8 +477,6 @@
476478 $this->mMissingRevIDs = array_keys($remaining);
477479
478480 // Populate all the page information
479 - if($this->mResolveRedirects)
480 - ApiBase :: dieDebug(__METHOD__, 'revids may not be used with redirect resolution');
481481 $this->initFromPageIds(array_keys($pageids));
482482 }
483483
Index: trunk/phase3/RELEASE-NOTES
@@ -160,6 +160,8 @@
161161 * list=search doesn't list missing pages any more
162162 * (bug 15178) Added clshow to prop=categories to allow filtering for hidden/
163163 non-hidden categories
 164+* (bug 15228) Combining revids= and redirects now throws a warning instead of an
 165+ error, and still resolves redirects generated by the generator.
164166
165167 === Languages updated in 1.14 ===
166168

Status & tagging log