From c3096d8ac658824762ba336ec7468e7ab9cf00b4 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 27 Apr 2009 14:09:47 +0000 Subject: [PATCH] API: (bug 18601) generator=backlinks returns invalid continue parameter. Patch by Brad Jorsch --- RELEASE-NOTES | 3 ++- includes/api/ApiQueryBacklinks.php | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 00223f65a6..24b9dca4c2 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -435,7 +435,8 @@ The following extensions are migrated into MediaWiki 1.15: * (bug 18546) Added timestamp of new revision to action=edit output * (bug 18554) Also list hidden revisions in list=usercontribs for privileged users -* (bug 13049) "API must be accessed from the primary script entry point" error +* (bug 13049) "API must be accessed from the primary script entry point" error +* (bug 18601) generator=backlinks returns invalid continue parameter === Languages updated in 1.15 === diff --git a/includes/api/ApiQueryBacklinks.php b/includes/api/ApiQueryBacklinks.php index 3300304157..b18986a7f2 100644 --- a/includes/api/ApiQueryBacklinks.php +++ b/includes/api/ApiQueryBacklinks.php @@ -206,6 +206,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { $this->extractRowInfo($row); else { + $this->pageMap[$row->page_namespace][$row->page_title] = $row->page_id; if($row->page_is_redirect) $this->redirTitles[] = Title::makeTitle($row->page_namespace, $row->page_title); $resultPageSet->processDbRow($row); @@ -229,7 +230,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { $parentID = $this->pageMap[$row->{$this->bl_ns}][$row->{$this->bl_title}]; else $parentID = $this->pageMap[NS_IMAGE][$row->{$this->bl_title}]; - $this->continueStr = $this->getContinueRedirStr($parentID, $row->page_id); + $this->continueStr = $this->getContinueRedirStr($parentID, $row->page_id); break; } @@ -408,7 +409,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { public function getParamDescription() { $retval = array ( - 'title' => 'Title to search. If null, titles= parameter will be used instead, but will be obsolete soon.', + 'title' => 'Title to search.', 'continue' => 'When more results are available, use this to continue.', 'namespace' => 'The namespace to enumerate.', 'filterredir' => 'How to filter for redirects' @@ -416,7 +417,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { if($this->getModuleName() != 'embeddedin') return array_merge($retval, array( 'redirect' => 'If linking page is a redirect, find all pages that link to that redirect as well. Maximum limit is halved.', - 'limit' => "How many total pages to return. If {$this->bl_code}redirect is enabled, limit applies to each level separately." + 'limit' => "How many total pages to return. If {$this->bl_code}redirect is enabled, limit applies to each level separately (which means you may get up to 2 * limit results)." )); return array_merge($retval, array( 'limit' => "How many total pages to return." -- 2.20.1