r54291 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54290‎ | r54291 | r54292 >
Date:17:48, 3 August 2009
Author:btongminh
Status:reverted (Comments)
Tags:
Comment:
(bug 19004) Added support for tags to the API. 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/ChangeTags.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)
  • /trunk/phase3/includes/specials/SpecialTags.php (modified) (history)

Diff [purge]

Index: trunk/phase3/CREDITS
@@ -83,6 +83,7 @@
8484 * Marcin Cieślak
8585 * Marcus Buck
8686 * Marooned
 87+* Matthew Britton
8788 * Max Semenik
8889 * Michael De La Rue
8990 * Michael Walsh
Index: trunk/phase3/includes/ChangeTags.php
@@ -185,4 +185,35 @@
186186 $wgMemc->set( $key, $emptyTags, 300 );
187187 return $emptyTags;
188188 }
 189+
 190+ /** Returns associative array of tag names and hitcounts */
 191+ static function getHitCounts() {
 192+
 193+ global $wgMemc;
 194+ $key = wfMemcKey( 'hitcounts' );
 195+
 196+ if ($hitcounts = $wgMemc->get( $key ))
 197+ return $hitcounts;
 198+
 199+ $dbr = wfGetDB( DB_SLAVE );
 200+ $hitcounts = array();
 201+
 202+ // Fetch defined tags
 203+ $res = $dbr->select( 'valid_tag', 'vt_tag', array(), __METHOD__ );
 204+ while( $row = $res->fetchObject() ) {
 205+ $hitcounts[$row->vt_tag] = 0;
 206+ }
 207+
 208+ // Fetch hit counts
 209+ $res = $dbr->select( 'change_tag', array('ct_tag', 'count(*) AS hitcount'), array(), __METHOD__, array('GROUP BY' => 'ct_tag', 'ORDER BY' => 'hitcount DESC') );
 210+
 211+ while( $row = $res->fetchObject() ) {
 212+ $hitcounts[$row->ct_tag] = $row->hitcount;
 213+ }
 214+
 215+ // Short-term caching
 216+ $wgMemc->set( $key, $hitcounts, 300 );
 217+ return $hitcounts;
 218+ }
 219+
189220 }
Index: trunk/phase3/includes/api/ApiQueryRecentChanges.php
@@ -42,7 +42,7 @@
4343
4444 private $fld_comment = false, $fld_user = false, $fld_flags = false,
4545 $fld_timestamp = false, $fld_title = false, $fld_ids = false,
46 - $fld_sizes = false;
 46+ $fld_sizes = false, $fld_tags = false;
4747 /**
4848 * Get an array mapping token names to their handler functions.
4949 * The prototype for a token function is func($pageid, $title, $rc)
@@ -174,6 +174,7 @@
175175 $this->fld_redirect = isset($prop['redirect']);
176176 $this->fld_patrolled = isset($prop['patrolled']);
177177 $this->fld_loginfo = isset($prop['loginfo']);
 178+ $this->fld_tags = isset($prop['tags']);
178179
179180 global $wgUser;
180181 if($this->fld_patrolled && !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol())
@@ -203,6 +204,17 @@
204205 $this->addFields('page_is_redirect');
205206 }
206207 }
 208+
 209+ if($this->fld_tags || !is_null($params['tag'])) {
 210+ $this->addTables('tag_summary');
 211+ $this->addJoinConds(array('tag_summary' => array('LEFT JOIN', array('rc_id=ts_rc_id'))));
 212+ $this->addFields('ts_tags');
 213+ }
 214+
 215+ if(!is_null($params['tag'])) {
 216+ $this->addWhereFld('ts_tags' , $params['tag']);
 217+ }
 218+
207219 $this->token = $params['token'];
208220 $this->addOption('LIMIT', $params['limit'] +1);
209221 $this->addOption('USE INDEX', array('recentchanges' => $index));
@@ -335,6 +347,10 @@
336348 $row->rc_log_type, $row->rc_timestamp);
337349 }
338350
 351+ if ($this->fld_tags && isset($row->ts_tags)) {
 352+ $vals['tags'] = $row->ts_tags;
 353+ }
 354+
339355 if(!is_null($this->token))
340356 {
341357 $tokenFunctions = $this->getTokenFunctions();
@@ -408,6 +424,7 @@
409425 'redirect',
410426 'patrolled',
411427 'loginfo',
 428+ 'tags',
412429 )
413430 ),
414431 'token' => array(
@@ -443,7 +460,8 @@
444461 'new',
445462 'log'
446463 )
447 - )
 464+ ),
 465+ 'tag' => null,
448466 );
449467 }
450468
@@ -462,6 +480,7 @@
463481 'For example, to see only minor edits done by logged-in users, set show=minor|!anon'
464482 ),
465483 'type' => 'Which types of changes to show.',
 484+ 'tag' => 'Only list changes with this tag',
466485 'limit' => 'How many total changes to return.'
467486 );
468487 }
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,16 @@
8687 $this->addFieldsIf('log_comment', $this->fld_comment);
8788 $this->addFieldsIf('log_params', $this->fld_details);
8889
 90+ if($this->fld_tags || !is_null($params['tag'])) {
 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->addWhereFld('ts_tags', $params['tag']);
 98+ }
 99+
89100 if( !is_null($params['type']) ) {
90101 $this->addWhereFld('log_type', $params['type']);
91102 $index = 'type_time';
@@ -247,6 +258,10 @@
248259 }
249260 }
250261
 262+ if ($this->fld_tags && isset($row->ts_tags)) {
 263+ $vals['tags'] = $row->ts_tags;
 264+ }
 265+
251266 return $vals;
252267 }
253268
@@ -265,6 +280,7 @@
266281 'timestamp',
267282 'comment',
268283 'details',
 284+ 'tags'
269285 )
270286 ),
271287 'type' => array (
@@ -285,6 +301,7 @@
286302 ),
287303 'user' => null,
288304 'title' => null,
 305+ 'tag' => null,
289306 'limit' => array (
290307 ApiBase :: PARAM_DFLT => 10,
291308 ApiBase :: PARAM_TYPE => 'limit',
@@ -304,6 +321,7 @@
305322 'dir' => 'In which direction to enumerate.',
306323 'user' => 'Filter entries to those made by the given user.',
307324 'title' => 'Filter entries to those related to a page.',
 325+ 'tag' => 'Only list entries with this tag',
308326 'limit' => 'How many total event entries to return.'
309327 );
310328 }
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',
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']);
@@ -135,6 +134,7 @@
136135 $this->fld_timestamp = isset ($prop['timestamp']);
137136 $this->fld_comment = isset ($prop['comment']);
138137 $this->fld_size = isset ($prop['size']);
 138+ $this->fld_tags = isset ($prop['tags']);
139139 $this->fld_user = isset ($prop['user']);
140140 $this->token = $params['token'];
141141 $this->diffto = $params['diffto'];
@@ -143,6 +143,16 @@
144144 $this->addFields( Revision::selectPageFields() );
145145 }
146146
 147+ if ($this->fld_tags || !is_null($params['tag'])) {
 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->addWhereFld('ts_tags', $params['tag']);
 155+ }
 156+
147157 if (isset ($prop['content'])) {
148158
149159 // For each page we will request, the user must have read rights for that page
@@ -293,9 +303,9 @@
294304 $this->setContinueEnumParameter('startid', intval($row->rev_id));
295305 break;
296306 }
297 - $revision = new Revision( $row );
 307+
298308 //
299 - $fit = $this->addPageSubItem($revision->getPage(), $this->extractRowInfo($revision), 'rev');
 309+ $fit = $this->addPageSubItem($row->rev_page, $this->extractRowInfo($row), 'rev');
300310 if(!$fit)
301311 {
302312 if($enumRevMode)
@@ -311,7 +321,8 @@
312322 $db->freeResult($res);
313323 }
314324
315 - private function extractRowInfo( $revision ) {
 325+ private function extractRowInfo( $row ) {
 326+ $revision = new Revision( $row );
316327 $title = $revision->getTitle();
317328 $vals = array ();
318329
@@ -353,6 +364,9 @@
354365 }
355366 }
356367
 368+ if ($this->fld_tags && $row->ts_tags)
 369+ $vals['tags'] = $row->ts_tags;
 370+
357371 if(!is_null($this->token))
358372 {
359373 $tokenFunctions = $this->getTokenFunctions();
@@ -427,6 +441,7 @@
428442 'size',
429443 'comment',
430444 'content',
 445+ 'tags'
431446 )
432447 ),
433448 'limit' => array (
@@ -460,6 +475,7 @@
461476 'excludeuser' => array(
462477 ApiBase :: PARAM_TYPE => 'user'
463478 ),
 479+ 'tag' => null,
464480 'expandtemplates' => false,
465481 'generatexml' => false,
466482 'section' => null,
@@ -483,6 +499,7 @@
484500 'dir' => 'direction of enumeration - towards "newer" or "older" revisions (enum)',
485501 'user' => 'only include revisions made by user',
486502 'excludeuser' => 'exclude revisions made by user',
 503+ 'tag' => 'only list revisions with this tag',
487504 'expandtemplates' => 'expand templates in revision content',
488505 'generatexml' => 'generate XML parse tree for revision content',
489506 'section' => 'only retrieve the content of this section',
Index: trunk/phase3/includes/api/ApiQueryTags.php
@@ -0,0 +1,167 @@
 2+<?php
 3+
 4+/*
 5+ * Created on Jul 9, 2009
 6+ *
 7+ * API for MediaWiki 1.8+
 8+ *
 9+ * Copyright (C) 2009 Matthew Britton <firstname>.<lastname>@btinternet.com
 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+ $ok = true;
 63+
 64+ if($this->fld_hitcount) {
 65+ foreach( ChangeTags::getHitCounts() as $tag => $count ) {
 66+ if(!$ok) break;
 67+ $ok = $this->doTag( $tag, $count );
 68+ }
 69+ } else {
 70+ foreach( ChangeTags::listDefinedTags() as $tag ) {
 71+ if(!$ok) break;
 72+ $ok = $this->doTag( $tag, 0 );
 73+ }
 74+ }
 75+
 76+ $this->result->setIndexedTagName_internal(array('query', $this->getModuleName()), 'tag');
 77+ }
 78+
 79+ private function doTag( $tagName, $hitcount ) {
 80+ static $count = 0;
 81+ static $doneTags = array();
 82+
 83+ if ( in_array( $tagName, $doneTags ) ) {
 84+ return true;
 85+ }
 86+
 87+ if(++$count > $this->limit)
 88+ {
 89+ $this->setContinueEnumParameter('continue', $tagName);
 90+ return false;
 91+ }
 92+
 93+ $tag = array();
 94+ $tag['name'] = $tagName;
 95+
 96+ if($this->fld_displayname)
 97+ $tag['displayname'] = ChangeTags::tagDescription( $tagName );
 98+
 99+ if($this->fld_description)
 100+ {
 101+ $msg = wfMsg( "tag-$tagName-description" );
 102+ $msg = wfEmptyMsg( "tag-$tagName-description", $msg ) ? '' : $msg;
 103+ $tag['description'] = $msg;
 104+ }
 105+
 106+ if($this->fld_hitcount)
 107+ $tag['hitcount'] = $hitcount;
 108+
 109+ $doneTags[] = $tagName;
 110+
 111+ $fit = $this->result->addValue(array('query', $this->getModuleName()), null, $tag);
 112+ if(!$fit)
 113+ {
 114+ $this->setContinueEnumParameter('continue', $tagName);
 115+ return false;
 116+ }
 117+
 118+ return true;
 119+ }
 120+
 121+ public function getAllowedParams() {
 122+ return array (
 123+ 'continue' => array(
 124+ ),
 125+ 'end' => array(
 126+ ),
 127+ 'limit' => array(
 128+ ApiBase :: PARAM_DFLT => 10,
 129+ ApiBase :: PARAM_TYPE => 'limit',
 130+ ApiBase :: PARAM_MIN => 1,
 131+ ApiBase :: PARAM_MAX => ApiBase :: LIMIT_BIG1,
 132+ ApiBase :: PARAM_MAX2 => ApiBase :: LIMIT_BIG2
 133+ ),
 134+ 'prop' => array(
 135+ ApiBase :: PARAM_DFLT => 'name',
 136+ ApiBase :: PARAM_TYPE => array(
 137+ 'name',
 138+ 'displayname',
 139+ 'description',
 140+ 'hitcount'
 141+ ),
 142+ ApiBase :: PARAM_ISMULTI => true
 143+ )
 144+ );
 145+ }
 146+
 147+ public function getParamDescription() {
 148+ return array (
 149+ 'continue' => 'When more results are available, use this to continue',
 150+ 'limit' => 'The maximum number of tags to list',
 151+ 'prop' => 'Which properties to get',
 152+ );
 153+ }
 154+
 155+ public function getDescription() {
 156+ return 'List change tags.';
 157+ }
 158+
 159+ protected function getExamples() {
 160+ return array (
 161+ 'api.php?action=query&list=tags&tgprop=displayname|description|hitcount'
 162+ );
 163+ }
 164+
 165+ public function getVersion() {
 166+ return __CLASS__ . ': $Id: ApiQueryTags.php';
 167+ }
 168+}
Property changes on: trunk/phase3/includes/api/ApiQueryTags.php
___________________________________________________________________
Name: svn:eol-style
1169 + native
Name: svn:keywords
2170 + 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,16 @@
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 || !is_null($this->params['tag'])) {
 252+ $this->addTables('tag_summary');
 253+ $this->addJoinConds(array('tag_summary' => array('LEFT JOIN', array('rev_id=ts_rev_id'))));
 254+ $this->addFields('ts_tags');
 255+ }
 256+
 257+ if( !is_null($this->params['tag']) ) {
 258+ $this->addWhereFld('ts_tags', $this->params['tag']);
 259+ }
249260 }
250261
251262 /**
@@ -292,6 +303,9 @@
293304 if ($this->fld_size && !is_null($row->rev_len))
294305 $vals['size'] = intval($row->rev_len);
295306
 307+ if ($this->fld_tags && $row->ts_tags)
 308+ $vals['tags'] = $row->ts_tags;
 309+
296310 return $vals;
297311 }
298312
@@ -343,6 +357,7 @@
344358 'size',
345359 'flags',
346360 'patrolled',
 361+ 'tags',
347362 )
348363 ),
349364 'show' => array (
@@ -354,6 +369,7 @@
355370 '!patrolled',
356371 )
357372 ),
 373+ 'tag' => null,
358374 );
359375 }
360376
@@ -370,6 +386,7 @@
371387 'prop' => 'Include additional pieces of information',
372388 'show' => array('Show only items that meet this criteria, e.g. non minor edits only: show=!minor',
373389 'NOTE: if show=patrolled or show=!patrolled is set, revisions older than $wgRCMaxAge won\'t be shown',),
 390+ 'tag' => 'Only list contributions with this tag',
374391 );
375392 }
376393
Index: trunk/phase3/includes/AutoLoader.php
@@ -304,6 +304,7 @@
305305 'ApiQueryRevisions' => 'includes/api/ApiQueryRevisions.php',
306306 'ApiQuerySearch' => 'includes/api/ApiQuerySearch.php',
307307 'ApiQuerySiteinfo' => 'includes/api/ApiQuerySiteinfo.php',
 308+ 'ApiQueryTags' => 'includes/api/ApiQueryTags.php',
308309 'ApiQueryUserInfo' => 'includes/api/ApiQueryUserInfo.php',
309310 'ApiQueryUsers' => 'includes/api/ApiQueryUsers.php',
310311 'ApiQueryWatchlist' => 'includes/api/ApiQueryWatchlist.php',
Index: trunk/phase3/includes/specials/SpecialTags.php
@@ -25,17 +25,11 @@
2626 Xml::tags( 'th', null, wfMsgExt( 'tags-description-header', 'parseinline' ) ) .
2727 Xml::tags( 'th', null, wfMsgExt( 'tags-hitcount-header', 'parseinline' ) )
2828 );
29 - $dbr = wfGetDB( DB_SLAVE );
30 - $res = $dbr->select( 'change_tag', array( 'ct_tag', 'count(*) as hitcount' ), array(), __METHOD__, array( 'GROUP BY' => 'ct_tag', 'ORDER BY' => 'hitcount DESC' ) );
3129
32 - while ( $row = $res->fetchObject() ) {
33 - $html .= $this->doTagRow( $row->ct_tag, $row->hitcount );
 30+ foreach( ChangeTags::getHitCounts() as $tag => $hitcount ) {
 31+ $html .= $this->doTagRow( $tag, $hitcount );
3432 }
3533
36 - foreach( ChangeTags::listDefinedTags() as $tag ) {
37 - $html .= $this->doTagRow( $tag, 0 );
38 - }
39 -
4034 $wgOut->addHTML( Xml::tags( 'table', array( 'class' => 'wikitable mw-tags-table' ), $html ) );
4135 }
4236
Index: trunk/phase3/RELEASE-NOTES
@@ -426,6 +426,7 @@
427427 * (bug 19907) $wgCrossSiteAJAXdomains added to allow specified (or all)
428428 external domains to access api.php via AJAX, if the browser supports the
429429 Access-Control-Allow-Origin HTTP header
 430+* (bug 19004) Added support for tags to the API.
430431
431432 === Languages updated in 1.16 ===
432433

Follow-up revisions

RevisionCommit summaryAuthorDate
r54304fix for r54291: missing ending $ in $Id$ialex19:57, 3 August 2009
r55332Revert r54291 "(bug 19004) Added support for tags to the API. Patch by Matthe...brion17:34, 19 August 2009
r58399API: (bug 19004) Add support for tags. Patch by Matthew Brittoncatrope10:42, 1 November 2009

Comments

#Comment by Bryan (talk | contribs)   17:56, 3 August 2009

On second look, it appears that the end parameter in query=tags is unused.

#Comment by Brion VIBBER (talk | contribs)   00:21, 5 August 2009

marking fixme per note.

#Comment by Catrope (talk | contribs)   12:41, 8 August 2009
+		if(!is_null($params['tag'])) {
+			$this->addWhereFld('ts_tags' , $params['tag']);
+		}

This doesn't work correctly, because ts_tags is a comma-separated list of tags. This means that querying for tag=foo will only find changes with foo as their only tag.

Also, the contents of ts_tags are output verbatim, that is as a comma-separated list of tag names. Converting this to an array would be nicer.

#Comment by Gurch (talk | contribs)   17:14, 13 August 2009

My apologies; I didn't realise it was a list. The only thing that generates tags at the moment is the Abuse Filter and that seems only to assign one tag to a revision, even when it could assign more, which I guess is why I thought that. Although that does at least mean it will work correctly until something starts adding multiple tags to a revision (is there a plan to do that?)

I assume the solution is to query change_tag rather than tag_summary when filtering?

#Comment by Catrope (talk | contribs)   17:21, 13 August 2009

Yes, that's right.

Status & tagging log