r58399 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58398‎ | r58399 | r58400 >
Date:10:42, 1 November 2009
Author:catrope
Status:resolved (Comments)
Tags:
Comment:
API: (bug 19004) Add support for tags. Patch by Matthew Britton
Modified paths:
  • /trunk/phase3/CREDITS (modified) (history)
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/AutoLoader.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQuery.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryLogEvents.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryRecentChanges.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryRevisions.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryTags.php (added) (history)
  • /trunk/phase3/includes/api/ApiQueryUserContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/CREDITS
@@ -86,6 +86,7 @@
8787 * Marcin Cieślak
8888 * Marcus Buck
8989 * Marooned
 90+* Matthew Britton
9091 * Matěj Grabovský
9192 * mati
9293 * Max Sikström
Index: trunk/phase3/includes/User.php
@@ -3577,7 +3577,7 @@
35783578 protected function loadOptions() {
35793579 global $wgCookiePrefix;
35803580 $this->load();
3581 - if ( $this->mOptionsLoaded || !$this->getId() )
 3581+ if ( $this->mOptionsLoaded )
35823582 return;
35833583
35843584 $this->mOptions = self::getDefaultOptions();
@@ -3589,20 +3589,11 @@
35903590 $this->mOptions[$key] = $value;
35913591 }
35923592 } else {
3593 - wfDebug( "Loading options for user " . $this->getId() . " from database.\n" );
3594 - // Load from database
3595 - $dbr = wfGetDB( DB_SLAVE );
3596 -
3597 - $res = $dbr->select(
3598 - 'user_properties',
3599 - '*',
3600 - array( 'up_user' => $this->getId() ),
3601 - __METHOD__
3602 - );
3603 -
3604 - while( $row = $dbr->fetchObject( $res ) ) {
3605 - $this->mOptionOverrides[$row->up_property] = $row->up_value;
3606 - $this->mOptions[$row->up_property] = $row->up_value;
 3593+ $this->mOptionOverrides = array();
 3594+ if ( $this->getId() ) {
 3595+ $this->loadOptionsFromDatabase();
 3596+ } else {
 3597+ $this->loadOptionsFromCookie();
36073598 }
36083599
36093600 //null skin if User::mId is loaded out of session data without persistant credentials
@@ -3616,23 +3607,73 @@
36173608 wfRunHooks( 'UserLoadOptions', array( $this, &$this->mOptions ) );
36183609 }
36193610
 3611+ protected function loadOptionsFromDatabase() {
 3612+ wfDebug( "Loading options for user ".$this->getId()." from database.\n" );
 3613+ // Load from database
 3614+ $dbr = wfGetDB( DB_SLAVE );
 3615+
 3616+ $res = $dbr->select(
 3617+ 'user_properties',
 3618+ '*',
 3619+ array('up_user' => $this->getId()),
 3620+ __METHOD__
 3621+ );
 3622+
 3623+ while( $row = $dbr->fetchObject( $res ) ) {
 3624+ $this->mOptionOverrides[$row->up_property] = $row->up_value;
 3625+ $this->mOptions[$row->up_property] = $row->up_value;
 3626+ }
 3627+ }
 3628+
 3629+ protected function loadOptionsFromCookie() {
 3630+ global $wgCookiePrefix;
 3631+ $cookie = $_COOKIE[$wgCookiePrefix."Options"];
 3632+
 3633+ $overrides = json_decode($cookie, true); // Load assoc array from cookie
 3634+
 3635+ foreach( $overrides as $key => $value ) {
 3636+ $this->mOptions[$key] = $value;
 3637+ $this->mOptionOverrides[$key] = $value;
 3638+ }
 3639+ }
 3640+
36203641 protected function saveOptions() {
36213642 global $wgAllowPrefChange;
36223643
3623 - $extuser = ExternalUser::newFromUser( $this );
3624 -
36253644 $this->loadOptions();
3626 - $dbw = wfGetDB( DB_MASTER );
36273645
3628 - $insert_rows = array();
3629 -
36303646 $saveOptions = $this->mOptions;
36313647
 3648+ $extuser = ExternalUser::newFromUser( $this );
 3649+ foreach( $saveOptions as $key => $value ) {
 3650+ if ( $extuser && isset( $wgAllowPrefChange[$key] ) ) {
 3651+ switch ( $wgAllowPrefChange[$key] ) {
 3652+ case 'local':
 3653+ case 'message':
 3654+ break;
 3655+ case 'semiglobal':
 3656+ case 'global':
 3657+ $extuser->setPref( $key, $value );
 3658+ }
 3659+ }
 3660+ }
 3661+
36323662 // Allow hooks to abort, for instance to save to a global profile.
36333663 // Reset options to default state before saving.
36343664 if( !wfRunHooks( 'UserSaveOptions', array( $this, &$saveOptions ) ) )
36353665 return;
36363666
 3667+ if ( $this->getId() ) {
 3668+ $this->saveOptionsToDatabase( $saveOptions );
 3669+ } else {
 3670+ $this->saveOptionsToCookie( $saveOptions );
 3671+ }
 3672+ }
 3673+
 3674+ protected function saveOptionsToDatabase( $saveOptions ) {
 3675+ $dbw = wfGetDB( DB_MASTER );
 3676+ $insert_rows = array();
 3677+
36373678 foreach( $saveOptions as $key => $value ) {
36383679 # Don't bother storing default values
36393680 if ( ( is_null( self::getDefaultOption( $key ) ) &&
@@ -3644,16 +3685,6 @@
36453686 'up_value' => $value,
36463687 );
36473688 }
3648 - if ( $extuser && isset( $wgAllowPrefChange[$key] ) ) {
3649 - switch ( $wgAllowPrefChange[$key] ) {
3650 - case 'local':
3651 - case 'message':
3652 - break;
3653 - case 'semiglobal':
3654 - case 'global':
3655 - $extuser->setPref( $key, $value );
3656 - }
3657 - }
36583689 }
36593690
36603691 $dbw->begin();
@@ -3662,6 +3693,12 @@
36633694 $dbw->commit();
36643695 }
36653696
 3697+ protected function saveOptionsToCookie( $saveOptions ) {
 3698+ global $wgRequest;
 3699+
 3700+ $data = json_encode( $saveOptions );
 3701+ $wgRequest->response()->setCookie( 'Options', $data, 86400 * 360 );
 3702+ }
36663703 /**
36673704 * Provide an array of HTML 5 attributes to put on an input element
36683705 * intended for the user to enter a new password. This may include
Index: trunk/phase3/includes/api/ApiQueryRecentChanges.php
@@ -96,6 +96,7 @@
9797 $this->fld_redirect = isset($prop['redirect']);
9898 $this->fld_patrolled = isset($prop['patrolled']);
9999 $this->fld_loginfo = isset($prop['loginfo']);
 100+ $this->fld_tags = isset($prop['tags']);
100101 }
101102
102103 /**
@@ -211,6 +212,18 @@
212213 $this->addFields('page_is_redirect');
213214 }
214215 }
 216+
 217+ if($this->fld_tags) {
 218+ $this->addTables('tag_summary');
 219+ $this->addJoinConds(array('tag_summary' => array('LEFT JOIN', array('rc_id=ts_rc_id'))));
 220+ $this->addFields('ts_tags');
 221+ }
 222+
 223+ if(!is_null($params['tag'])) {
 224+ $this->addTables('change_tag');
 225+ $this->addJoinConds(array('change_tag' => array('INNER JOIN', array('rc_id=ct_rc_id'))));
 226+ $this->addWhereFld('ct_tag' , $params['tag']);
 227+ }
215228 $this->token = $params['token'];
216229 $this->addOption('LIMIT', $params['limit'] +1);
217230 $this->addOption('USE INDEX', array('recentchanges' => $index));
@@ -343,6 +356,16 @@
344357 $row->rc_log_type, $row->rc_timestamp);
345358 }
346359
 360+ if ($this->fld_tags) {
 361+ if ($row->ts_tags) {
 362+ $tags = explode(',', $row->ts_tags);
 363+ $this->getResult()->setIndexedTagName($tags, 'tag');
 364+ $vals['tags'] = $tags;
 365+ } else {
 366+ $vals['tags'] = array();
 367+ }
 368+ }
 369+
347370 if(!is_null($this->token))
348371 {
349372 $tokenFunctions = $this->getTokenFunctions();
@@ -416,6 +439,7 @@
417440 'redirect',
418441 'patrolled',
419442 'loginfo',
 443+ 'tags'
420444 )
421445 ),
422446 'token' => array(
Index: trunk/phase3/includes/api/ApiQueryLogEvents.php
@@ -51,6 +51,7 @@
5252 $this->fld_timestamp = in_array('timestamp', $prop);
5353 $this->fld_comment = in_array('comment', $prop);
5454 $this->fld_details = in_array('details', $prop);
 55+ $this->fld_tags = in_array('tags', $prop);
5556
5657 list($tbl_logging, $tbl_page, $tbl_user) = $db->tableNamesN('logging', 'page', 'user');
5758
@@ -85,6 +86,18 @@
8687 $this->addFieldsIf('log_comment', $this->fld_comment);
8788 $this->addFieldsIf('log_params', $this->fld_details);
8889
 90+ if($this->fld_tags) {
 91+ $this->addTables('tag_summary');
 92+ $this->addJoinConds(array('tag_summary' => array('LEFT JOIN', 'log_id=ts_log_id')));
 93+ $this->addFields('ts_tags');
 94+ }
 95+
 96+ if( !is_null($params['tag']) ) {
 97+ $this->addTables('change_tag');
 98+ $this->addJoinConds(array('change_tag' => array('INNER JOIN', array('log_id=ct_log_id'))));
 99+ $this->addWhereFld('ct_tag', $params['tag']);
 100+ }
 101+
89102 if( !is_null($params['type']) ) {
90103 $this->addWhereFld('log_type', $params['type']);
91104 $index = 'type_time';
@@ -247,6 +260,16 @@
248261 }
249262 }
250263
 264+ if ($this->fld_tags) {
 265+ if ($row->ts_tags) {
 266+ $tags = explode(',', $row->ts_tags);
 267+ $this->getResult()->setIndexedTagName($tags, 'tag');
 268+ $vals['tags'] = $tags;
 269+ } else {
 270+ $vals['tags'] = array();
 271+ }
 272+ }
 273+
251274 return $vals;
252275 }
253276
@@ -265,6 +288,7 @@
266289 'timestamp',
267290 'comment',
268291 'details',
 292+ 'tags'
269293 )
270294 ),
271295 'type' => array (
Index: trunk/phase3/includes/api/ApiQuery.php
@@ -74,6 +74,7 @@
7575 'logevents' => 'ApiQueryLogEvents',
7676 'recentchanges' => 'ApiQueryRecentChanges',
7777 'search' => 'ApiQuerySearch',
 78+ 'tags' => 'ApiQueryTags',
7879 'usercontribs' => 'ApiQueryContributions',
7980 'watchlist' => 'ApiQueryWatchlist',
8081 'watchlistraw' => 'ApiQueryWatchlistRaw',
@@ -584,4 +585,4 @@
585586 $vers[] = $psModule->getVersion();
586587 return $vers;
587588 }
588 -}
\ No newline at end of file
 589+}
Index: trunk/phase3/includes/api/ApiQueryRevisions.php
@@ -42,7 +42,7 @@
4343 }
4444
4545 private $fld_ids = false, $fld_flags = false, $fld_timestamp = false, $fld_size = false,
46 - $fld_comment = false, $fld_user = false, $fld_content = false;
 46+ $fld_comment = false, $fld_user = false, $fld_content = false, $fld_tags = false;
4747
4848 protected function getTokenFunctions() {
4949 // tokenname => function
@@ -121,9 +121,8 @@
122122 }
123123
124124 $db = $this->getDB();
125 - $this->addTables('revision');
 125+ $this->addTables(array('page', 'revision'));
126126 $this->addFields(Revision::selectFields());
127 - $this->addTables('page');
128127 $this->addWhere('page_id = rev_page');
129128
130129 $prop = array_flip($params['prop']);
@@ -143,6 +142,19 @@
144143 $this->addFields( Revision::selectPageFields() );
145144 }
146145
 146+ if (isset ($prop['tags'])) {
 147+ $this->fld_tags = true;
 148+ $this->addTables('tag_summary');
 149+ $this->addJoinConds(array('tag_summary' => array('LEFT JOIN', array('rev_id=ts_rev_id'))));
 150+ $this->addFields('ts_tags');
 151+ }
 152+
 153+ if( !is_null($params['tag']) ) {
 154+ $this->addTables('change_tag');
 155+ $this->addJoinConds(array('change_tag' => array('INNER JOIN', array('rev_id=ct_rev_id'))));
 156+ $this->addWhereFld('ct_tag' , $params['tag']);
 157+ }
 158+
147159 if (isset ($prop['content'])) {
148160
149161 // For each page we will request, the user must have read rights for that page
@@ -293,9 +305,9 @@
294306 $this->setContinueEnumParameter('startid', intval($row->rev_id));
295307 break;
296308 }
297 - $revision = new Revision( $row );
 309+
298310 //
299 - $fit = $this->addPageSubItem($revision->getPage(), $this->extractRowInfo($revision), 'rev');
 311+ $fit = $this->addPageSubItem($row->rev_page, $this->extractRowInfo($row), 'rev');
300312 if(!$fit)
301313 {
302314 if($enumRevMode)
@@ -311,7 +323,8 @@
312324 $db->freeResult($res);
313325 }
314326
315 - private function extractRowInfo( $revision ) {
 327+ private function extractRowInfo( $row ) {
 328+ $revision = new Revision( $row );
316329 $title = $revision->getTitle();
317330 $vals = array ();
318331
@@ -353,6 +366,16 @@
354367 }
355368 }
356369
 370+ if ($this->fld_tags) {
 371+ if ($row->ts_tags) {
 372+ $tags = explode(',', $row->ts_tags);
 373+ $this->getResult()->setIndexedTagName($tags, 'tag');
 374+ $vals['tags'] = $tags;
 375+ } else {
 376+ $vals['tags'] = array();
 377+ }
 378+ }
 379+
357380 if(!is_null($this->token))
358381 {
359382 $tokenFunctions = $this->getTokenFunctions();
@@ -427,6 +450,7 @@
428451 'size',
429452 'comment',
430453 'content',
 454+ 'tags'
431455 )
432456 ),
433457 'limit' => array (
Index: trunk/phase3/includes/api/ApiQueryTags.php
@@ -0,0 +1,177 @@
 2+<?php
 3+
 4+/*
 5+ * Created on Jul 9, 2009
 6+ *
 7+ * API for MediaWiki 1.8+
 8+ *
 9+ * Copyright (C) 2009
 10+ *
 11+ * This program is free software; you can redistribute it and/or modify
 12+ * it under the terms of the GNU General Public License as published by
 13+ * the Free Software Foundation; either version 2 of the License, or
 14+ * (at your option) any later version.
 15+ *
 16+ * This program is distributed in the hope that it will be useful,
 17+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
 18+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 19+ * GNU General Public License for more details.
 20+ *
 21+ * You should have received a copy of the GNU General Public License along
 22+ * with this program; if not, write to the Free Software Foundation, Inc.,
 23+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 24+ * http://www.gnu.org/copyleft/gpl.html
 25+ */
 26+
 27+if (!defined('MEDIAWIKI')) {
 28+ // Eclipse helper - will be ignored in production
 29+ require_once ('ApiQueryBase.php');
 30+}
 31+
 32+/**
 33+ * Query module to enumerate change tags.
 34+ *
 35+ * @ingroup API
 36+ */
 37+class ApiQueryTags extends ApiQueryBase {
 38+
 39+ private $limit, $result;
 40+ private $fld_displayname = false, $fld_description = false,
 41+ $fld_hitcount = false;
 42+
 43+ public function __construct($query, $moduleName) {
 44+ parent :: __construct($query, $moduleName, 'tg');
 45+ }
 46+
 47+ public function execute() {
 48+ $params = $this->extractRequestParams();
 49+
 50+ $prop = array_flip($params['prop']);
 51+
 52+ $this->fld_displayname = isset($prop['displayname']);
 53+ $this->fld_description = isset($prop['description']);
 54+ $this->fld_hitcount = isset($prop['hitcount']);
 55+
 56+ $this->limit = $params['limit'];
 57+ $this->result = $this->getResult();
 58+
 59+ $pageSet = $this->getPageSet();
 60+ $titles = $pageSet->getTitles();
 61+ $data = array();
 62+
 63+ $this->addTables('change_tag');
 64+ $this->addFields('ct_tag');
 65+
 66+ if($this->fld_hitcount)
 67+ $this->addFields('count(*) AS hitcount');
 68+
 69+ $this->addOption('LIMIT', $this->limit + 1);
 70+ $this->addOption('GROUP BY', 'ct_tag');
 71+ $this->addWhereRange('ct_tag', 'newer', $params['continue'], null);
 72+
 73+ $res = $this->select(__METHOD__);
 74+
 75+ $ok = true;
 76+
 77+ while ( $row = $res->fetchObject() ) {
 78+ if(!$ok) break;
 79+ $ok = $this->doTag( $row->ct_tag, $row->hitcount );
 80+ }
 81+
 82+ //include tags with no hits yet
 83+ foreach( ChangeTags::listDefinedTags() as $tag ) {
 84+ if(!$ok) break;
 85+ $ok = $this->doTag( $tag, 0 );
 86+ }
 87+
 88+ $this->result->setIndexedTagName_internal(array('query', $this->getModuleName()), 'tag');
 89+ }
 90+
 91+ private function doTag( $tagName, $hitcount ) {
 92+ static $count = 0;
 93+ static $doneTags = array();
 94+
 95+ if ( in_array( $tagName, $doneTags ) ) {
 96+ return true;
 97+ }
 98+
 99+ if(++$count > $this->limit)
 100+ {
 101+ $this->setContinueEnumParameter('continue', $tagName);
 102+ return false;
 103+ }
 104+
 105+ $tag = array();
 106+ $tag['name'] = $tagName;
 107+
 108+ if($this->fld_displayname)
 109+ $tag['displayname'] = ChangeTags::tagDescription( $tagName );
 110+
 111+ if($this->fld_description)
 112+ {
 113+ $msg = wfMsg( "tag-$tagName-description" );
 114+ $msg = wfEmptyMsg( "tag-$tagName-description", $msg ) ? '' : $msg;
 115+ $tag['description'] = $msg;
 116+ }
 117+
 118+ if($this->fld_hitcount)
 119+ $tag['hitcount'] = $hitcount;
 120+
 121+ $doneTags[] = $tagName;
 122+
 123+ $fit = $this->result->addValue(array('query', $this->getModuleName()), null, $tag);
 124+ if(!$fit)
 125+ {
 126+ $this->setContinueEnumParameter('continue', $tagName);
 127+ return false;
 128+ }
 129+
 130+ return true;
 131+ }
 132+
 133+ public function getAllowedParams() {
 134+ return array (
 135+ 'continue' => array(
 136+ ),
 137+ 'limit' => array(
 138+ ApiBase :: PARAM_DFLT => 10,
 139+ ApiBase :: PARAM_TYPE => 'limit',
 140+ ApiBase :: PARAM_MIN => 1,
 141+ ApiBase :: PARAM_MAX => ApiBase :: LIMIT_BIG1,
 142+ ApiBase :: PARAM_MAX2 => ApiBase :: LIMIT_BIG2
 143+ ),
 144+ 'prop' => array(
 145+ ApiBase :: PARAM_DFLT => 'name',
 146+ ApiBase :: PARAM_TYPE => array(
 147+ 'name',
 148+ 'displayname',
 149+ 'description',
 150+ 'hitcount'
 151+ ),
 152+ ApiBase :: PARAM_ISMULTI => true
 153+ )
 154+ );
 155+ }
 156+
 157+ public function getParamDescription() {
 158+ return array (
 159+ 'continue' => 'When more results are available, use this to continue',
 160+ 'limit' => 'The maximum number of tags to list',
 161+ 'prop' => 'Which properties to get',
 162+ );
 163+ }
 164+
 165+ public function getDescription() {
 166+ return 'List change tags.';
 167+ }
 168+
 169+ protected function getExamples() {
 170+ return array (
 171+ 'api.php?action=query&list=tags&tgprop=displayname|description|hitcount'
 172+ );
 173+ }
 174+
 175+ public function getVersion() {
 176+ return __CLASS__ . ': $Id: ApiQueryTags.php';
 177+ }
 178+}
Property changes on: trunk/phase3/includes/api/ApiQueryTags.php
___________________________________________________________________
Name: svn:eol-style
1179 + native
Name: svn:keywords
2180 + Id
Index: trunk/phase3/includes/api/ApiQueryUserContributions.php
@@ -42,7 +42,7 @@
4343 private $params, $username;
4444 private $fld_ids = false, $fld_title = false, $fld_timestamp = false,
4545 $fld_comment = false, $fld_flags = false,
46 - $fld_patrolled = false;
 46+ $fld_patrolled = false, $fld_tags = false;
4747
4848 public function execute() {
4949
@@ -57,6 +57,7 @@
5858 $this->fld_flags = isset($prop['flags']);
5959 $this->fld_timestamp = isset($prop['timestamp']);
6060 $this->fld_patrolled = isset($prop['patrolled']);
 61+ $this->fld_tags = isset($prop['tags']);
6162
6263 // TODO: if the query is going only against the revision table, should this be done?
6364 $this->selectNamedDB('contributions', DB_SLAVE, 'contributions');
@@ -141,7 +142,7 @@
142143 private function prepareQuery() {
143144 // We're after the revision table, and the corresponding page
144145 // row for anything we retrieve. We may also need the
145 - // recentchanges row.
 146+ // recentchanges row and/or tag summary row.
146147 global $wgUser;
147148 $tables = array('page', 'revision'); // Order may change
148149 $this->addWhere('page_id=rev_page');
@@ -245,6 +246,19 @@
246247 $this->addFieldsIf('rev_minor_edit', $this->fld_flags);
247248 $this->addFieldsIf('rev_parent_id', $this->fld_flags);
248249 $this->addFieldsIf('rc_patrolled', $this->fld_patrolled);
 250+
 251+ if($this->fld_tags)
 252+ {
 253+ $this->addTables('tag_summary');
 254+ $this->addJoinConds(array('tag_summary' => array('LEFT JOIN', array('rev_id=ts_rev_id'))));
 255+ $this->addFields('ts_tags');
 256+ }
 257+
 258+ if( !is_null($this->params['tag']) ) {
 259+ $this->addTables('change_tag');
 260+ $this->addJoinConds(array('change_tag' => array('INNER JOIN', array('rev_id=ct_rev_id'))));
 261+ $this->addWhereFld('ct_tag', $this->params['tag']);
 262+ }
249263 }
250264
251265 /**
@@ -292,6 +306,16 @@
293307 if ($this->fld_size && !is_null($row->rev_len))
294308 $vals['size'] = intval($row->rev_len);
295309
 310+ if ($this->fld_tags) {
 311+ if ($row->ts_tags) {
 312+ $tags = explode(',', $row->ts_tags);
 313+ $this->getResult()->setIndexedTagName($tags, 'tag');
 314+ $vals['tags'] = $tags;
 315+ } else {
 316+ $vals['tags'] = array();
 317+ }
 318+ }
 319+
296320 return $vals;
297321 }
298322
@@ -343,6 +367,7 @@
344368 'size',
345369 'flags',
346370 'patrolled',
 371+ 'tags'
347372 )
348373 ),
349374 'show' => array (
Index: trunk/phase3/includes/AutoLoader.php
@@ -320,6 +320,7 @@
321321 'ApiQueryRevisions' => 'includes/api/ApiQueryRevisions.php',
322322 'ApiQuerySearch' => 'includes/api/ApiQuerySearch.php',
323323 'ApiQuerySiteinfo' => 'includes/api/ApiQuerySiteinfo.php',
 324+ 'ApiQueryTags' => 'includes/api/ApiQueryTags.php',
324325 'ApiQueryUserInfo' => 'includes/api/ApiQueryUserInfo.php',
325326 'ApiQueryUsers' => 'includes/api/ApiQueryUsers.php',
326327 'ApiQueryWatchlist' => 'includes/api/ApiQueryWatchlist.php',
Index: trunk/phase3/RELEASE-NOTES
@@ -674,6 +674,7 @@
675675 drcontinue param is passed
676676 * (bug 21106) Deprecated parameters now tagged in action=paraminfo
677677 * (bug 13453) rebuildrecentchanges maintenance script works on PG again
 678+* (bug 19004) Added support for tags
678679
679680 === Languages updated in 1.16 ===
680681

Follow-up revisions

RevisionCommit summaryAuthorDate
r58403Revert accidentally committed stuff in r58399catrope19:48, 1 November 2009
r58410Should fix Undefined index: tag in includes/api/ApiQueryRevisions.php on lin...siebrand21:49, 1 November 2009
r58419Redo r58410, r58411 (attempts to to fix r58399) properly: isset vs. !is_null ...catrope08:29, 2 November 2009
r61957Fix for r58399 (missing index on change_tag table), using the patch from bug ...tstarling23:30, 3 February 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r54291(bug 19004) Added support for tags to the API. Patch by Matthew Britton.btongminh17:48, 3 August 2009
r55332Revert r54291 "(bug 19004) Added support for tags to the API. Patch by Matthe...brion17:34, 19 August 2009

Comments

#Comment by Church of emacs (talk | contribs)   18:33, 1 November 2009

Gives me the following notice:
Notice: Undefined index: wikidatabasename_wiki_Options in /path/to/wiki/includes/User.php on line 3631

#Comment by Catrope (talk | contribs)   19:46, 1 November 2009

Are you sure it's caused by this revision? It looks like a preferences and/or cookie bug; this commit doesn't even touch User.php

#Comment by Catrope (talk | contribs)   19:48, 1 November 2009

Oh wait, it does. Reverted unintended changes in r58403.

#Comment by Siebrand (talk | contribs)   21:36, 1 November 2009

PHP Notice: Undefined index: tag in includes/api/ApiQueryRevisions.php on line 152

#Comment by Gurch (talk | contribs)   23:48, 1 November 2009

Looks like I mixed up isset() and !is_null(), sorry about that. one of these days I might actually learn PHP :/

#Comment by Catrope (talk | contribs)   08:30, 2 November 2009

That wasn't it: you forgot to declare the (rv|le|rc)tag parameters. Fixed in r58419

#Comment by Tim Starling (talk | contribs)   05:59, 5 January 2010

This omits the FORCE INDEX on the change_tag table when tag filtering is being done (i.e. with rctag=foo). Without this index, there's a chance this module will crash the site, like the UI version did before r49068. Presumably rvtag and letag are also affected, but I haven't tested them.

#Comment by Catrope (talk | contribs)   13:19, 6 January 2010

I need to force the change_tag_tag_id index, correct? According to http://www.mediawiki.org/wiki/Special:Code/MediaWiki/49068#c2909 that index has a different name on Wikimedia (ct_tag).

#Comment by Gurch (talk | contribs)   06:02, 26 January 2010

Added a patch that should fix this to bug 22032.

#Comment by Tim Starling (talk | contribs)   23:30, 3 February 2010

Fixed in r61957.

Status & tagging log