From fe833aeddc7c88b6bdbb535faf7926e644817619 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 18 Aug 2008 20:48:45 +0000 Subject: [PATCH] (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 tag rather than --- RELEASE-NOTES | 2 ++ includes/api/ApiPageSet.php | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c081abf7e6..f251348a4a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -160,6 +160,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * list=search doesn't list missing pages any more * (bug 15178) Added clshow to prop=categories to allow filtering for hidden/ non-hidden categories +* (bug 15228) Combining revids= and redirects now throws a warning instead of an + error, and still resolves redirects generated by the generator. === Languages updated in 1.14 === diff --git a/includes/api/ApiPageSet.php b/includes/api/ApiPageSet.php index cfb342c591..32d4500fd9 100644 --- a/includes/api/ApiPageSet.php +++ b/includes/api/ApiPageSet.php @@ -53,7 +53,7 @@ class ApiPageSet extends ApiQueryBase { private $mRequestedPageFields; public function __construct($query, $resolveRedirects = false) { - parent :: __construct($query, __CLASS__); + parent :: __construct($query, 'query'); $this->mAllPages = array (); $this->mTitles = array(); @@ -254,7 +254,9 @@ class ApiPageSet extends ApiQueryBase { break; case 'revids' : if($this->mResolveRedirects) - $this->dieUsage('revids may not be used with redirect resolution', 'params'); + $this->setWarning('Redirect resolution cannot be used together with the revids= parameter. '. + 'Any redirects the revids= point to have not been resolved.'); + $this->mResolveRedirects = false; $this->initFromRevIDs($revids); break; default : @@ -475,8 +477,6 @@ class ApiPageSet extends ApiQueryBase { $this->mMissingRevIDs = array_keys($remaining); // Populate all the page information - if($this->mResolveRedirects) - ApiBase :: dieDebug(__METHOD__, 'revids may not be used with redirect resolution'); $this->initFromPageIds(array_keys($pageids)); } -- 2.20.1