r25476 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25475‎ | r25476 | r25477 >
Date:14:44, 4 September 2007
Author:catrope
Status:old
Tags:
Comment:
(bug 10980) Add exclude redirects on backlinks
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryBacklinks.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryBacklinks.php
@@ -102,7 +102,7 @@
103103
104104 $redirect = $this->params['redirect'];
105105 if ($redirect)
106 - ApiBase :: dieDebug(__METHOD__, 'Redirect has not been implemented', 'notimplemented');
 106+ $this->dieDebug('Redirect has not been implemented', 'notimplemented');
107107
108108 $this->processContinue();
109109
@@ -124,13 +124,15 @@
125125 $this->addWhereFld($this->bl_title, $this->rootTitle->getDBkey());
126126 $this->addWhereFld('page_namespace', $this->params['namespace']);
127127
 128+ if($this->params['filterredir'] == 'redirects')
 129+ $this->addWhereFld('page_is_redirect', 1);
 130+ if($this->params['filterredir'] == 'nonredirects')
 131+ $this->addWhereFld('page_is_redirect', 0);
 132+
128133 $limit = $this->params['limit'];
129134 $this->addOption('LIMIT', $limit +1);
130135 $this->addOption('ORDER BY', $this->bl_sort);
131136
132 - if ($redirect)
133 - $this->addWhereFld('page_is_redirect', 0);
134 -
135137 $db = $this->getDB();
136138 if (!is_null($this->params['continue'])) {
137139 $plfrm = intval($this->contID);
@@ -322,6 +324,14 @@
323325 ApiBase :: PARAM_ISMULTI => true,
324326 ApiBase :: PARAM_TYPE => 'namespace'
325327 ),
 328+ 'filterredir' => array(
 329+ ApiBase :: PARAM_DFLT => 'all',
 330+ ApiBase :: PARAM_TYPE => array(
 331+ 'all',
 332+ 'redirects',
 333+ 'nonredirects'
 334+ )
 335+ ),
326336 'redirect' => false,
327337 'limit' => array (
328338 ApiBase :: PARAM_DFLT => 10,
@@ -338,6 +348,7 @@
339349 'title' => 'Title to search. If null, titles= parameter will be used instead, but will be obsolete soon.',
340350 'continue' => 'When more results are available, use this to continue.',
341351 'namespace' => 'The namespace to enumerate.',
 352+ 'filterredir' => 'How to filter for redirects',
342353 'redirect' => 'If linking page is a redirect, find all pages that link to that redirect (not implemented)',
343354 'limit' => 'How many total pages to return.'
344355 );
Index: trunk/phase3/RELEASE-NOTES
@@ -497,6 +497,7 @@
498498 * (bug 11115) Adding SHA1 hash to imageinfo query
499499 * (bug 10898) API does not return an edit token for non-existent pages
500500 * (bug 10890) Timestamp support for categorymembers query
 501+* (bug 10980) Add exclude redirects on backlinks
501502
502503 == Maintenance script changes since 1.10 ==
503504

Follow-up revisions

RevisionCommit summaryAuthorDate
r25530Merged revisions 25454-25529 via svnmerge from...david08:28, 5 September 2007

Status & tagging log