r44718 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44717‎ | r44718 | r44719 >
Date:15:35, 17 December 2008
Author:catrope
Status:ok
Tags:
Comment:
Revert r44716 (added user,excludeuser to watchlist,recentchanges): can't commit this just yet because not all WMF servers have the user_text index just yet, see also bug 14200
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryRecentChanges.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryWatchlist.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryRecentChanges.php
@@ -84,7 +84,7 @@
8585 */
8686 public function execute() {
8787 /* Initialize vars */
88 - $limit = $prop = $namespace = $titles = $user = $excludeuser = $show = $type = $dir = $start = $end = $token = null;
 88+ $limit = $prop = $namespace = $titles = $show = $type = $dir = $start = $end = $token = null;
8989
9090 /* Get the parameters of the request. */
9191 extract($this->extractRequestParams());
@@ -154,15 +154,8 @@
155155 // Don't throw log entries out the window here
156156 $this->addWhereIf('page_is_redirect = 0 OR page_is_redirect IS NULL', isset ($show['!redirect']));
157157 }
158 -
159 - if(!is_null($user) && !is_null($excludeuser))
160 - $this->dieUsage('user and excludeuser cannot be used together', 'badparams');
161 - if(!is_null($user))
162 - $this->addWhereFld('rc_user_text', $user);
163 - if(!is_null($excludeuser))
164 - $this->addWhere('rc_user_text != ' . $this->getDB()->addQuotes($excludeuser));
165158
166 - /* Add the fields we're concerned with to our query. */
 159+ /* Add the fields we're concerned with to out query. */
167160 $this->addFields(array (
168161 'rc_timestamp',
169162 'rc_namespace',
@@ -404,12 +397,6 @@
405398 'titles' => array(
406399 ApiBase :: PARAM_ISMULTI => true
407400 ),
408 - 'user' => array(
409 - ApiBase :: PARAM_TYPE => 'user'
410 - ),
411 - 'excludeuser' => array(
412 - ApiBase :: PARAM_TYPE => 'user'
413 - ),
414401 'prop' => array (
415402 ApiBase :: PARAM_ISMULTI => true,
416403 ApiBase :: PARAM_DFLT => 'title|timestamp|ids',
@@ -470,8 +457,6 @@
471458 'dir' => 'In which direction to enumerate.',
472459 'namespace' => 'Filter log entries to only this namespace(s)',
473460 'titles' => 'Filter log entries to only these page titles',
474 - 'user' => 'Only list changes by this user',
475 - 'excludeuser' => 'Don\'t list changes by this user',
476461 'prop' => 'Include additional pieces of information',
477462 'token' => 'Which tokens to obtain for each change',
478463 'show' => array (
Index: trunk/phase3/includes/api/ApiQueryWatchlist.php
@@ -59,7 +59,7 @@
6060 if (!$wgUser->isLoggedIn())
6161 $this->dieUsage('You must be logged-in to have a watchlist', 'notloggedin');
6262
63 - $allrev = $start = $end = $namespace = $user = $excludeuser = $dir = $limit = $prop = $show = null;
 63+ $allrev = $start = $end = $namespace = $dir = $limit = $prop = $show = null;
6464 extract($this->extractRequestParams());
6565
6666 if (!is_null($prop) && is_null($resultPageSet)) {
@@ -162,13 +162,6 @@
163163 $this->addWhereIf('rc_patrolled = 0', isset($show['!patrolled']));
164164 $this->addWhereIf('rc_patrolled != 0', isset($show['patrolled']));
165165 }
166 -
167 - if(!is_null($user) && !is_null($excludeuser))
168 - $this->dieUsage('user and excludeuser cannot be used together', 'badparams');
169 - if(!is_null($user))
170 - $this->addWhereFld('rc_user_text', $user);
171 - if(!is_null($excludeuser))
172 - $this->addWhere('rc_user_text != ' . $this->getDB()->addQuotes($excludeuser));
173166
174167
175168 # This is an index optimization for mysql, as done in the Special:Watchlist page
@@ -271,12 +264,6 @@
272265 ApiBase :: PARAM_ISMULTI => true,
273266 ApiBase :: PARAM_TYPE => 'namespace'
274267 ),
275 - 'user' => array(
276 - ApiBase :: PARAM_TYPE => 'user',
277 - ),
278 - 'excludeuser' => array(
279 - ApiBase :: PARAM_TYPE => 'user',
280 - ),
281268 'dir' => array (
282269 ApiBase :: PARAM_DFLT => 'older',
283270 ApiBase :: PARAM_TYPE => array (
@@ -327,8 +314,6 @@
328315 'start' => 'The timestamp to start enumerating from.',
329316 'end' => 'The timestamp to end enumerating.',
330317 'namespace' => 'Filter changes to only the given namespace(s).',
331 - 'user' => 'Only list changes by this user',
332 - 'excludeuser' => 'Don\'t list changes by this user',
333318 'dir' => 'In which direction to enumerate pages.',
334319 'limit' => 'How many total results to return per request.',
335320 'prop' => 'Which additional items to get (non-generator mode only).',
Index: trunk/phase3/RELEASE-NOTES
@@ -530,10 +530,7 @@
531531 * (bug 16647) list=allcategories, prop=categories don't return "hidden"
532532 property for hidden categories
533533 * New siprop parameter of 'extensions' to list all installed extensions
534 -* (bug 16672) Include canonical namespace name in
535 - meta=siteinfo&siprop=namespaces.
536 -* (bug 16527) Added user and excludeuser parameters to list=watchlist and
537 - list=recentchanges
 534+* (bug 16672) Include canonical namespace name in meta=siteinfo&siprop=namespaces.
538535
539536 === Languages updated in 1.14 ===
540537

Follow-up revisions

RevisionCommit summaryAuthorDate
r52152API: (bug 14200) Add user and excludeuser to list=recentchanges and list=watc...catrope08:03, 19 June 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r44716API: (bug 16527) Added user and excludeuser parameters to list=watchlist,rece...catrope14:50, 17 December 2008

Status & tagging log