From e27944217b118b6efbc6222921d4a38db462acb7 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 4 Aug 2012 22:20:00 +0200 Subject: [PATCH] Show tagfilter, when transclude RC special pages This reverts bug 23293, because with tagfilter, I see no UNIQ things. By the way, the fix for bug 23293 was not the best, because it modify for two pages the query and for the third only the display part. This also realign the ChangeTags::modifyDisplayQuery calls and fix the way, SpecialNewImages gets 'ts_tags' into the select Change-Id: I09cfa5697561970399622920214a569e9a712080 --- RELEASE-NOTES-1.20 | 1 + includes/specials/SpecialNewpages.php | 11 ++++------- includes/specials/SpecialRecentchanges.php | 17 +++++++++-------- .../specials/SpecialRecentchangeslinked.php | 12 ++++++++---- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/RELEASE-NOTES-1.20 b/RELEASE-NOTES-1.20 index ac456bf1f3..6b9de400f6 100644 --- a/RELEASE-NOTES-1.20 +++ b/RELEASE-NOTES-1.20 @@ -127,6 +127,7 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki. * Allow importing pages as subpage. * Add lang and hreflang attributes to language links on Login page. * (bug 22749) Create Special:MostInterwikis. +* Show change tags when transclude Special:Recentchanges(linked) or Special:Newpages. === Bug fixes in 1.20 === * (bug 30245) Use the correct way to construct a log page title. diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index 19ea1719c0..8e15d554fe 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -360,8 +360,8 @@ class SpecialNewpages extends IncludableSpecialPage { $classes[] = 'mw-newpages-zero-byte-page'; } - # Tags, if any. check for including due to bug 23293 - if ( !$this->including() ) { + # Tags, if any. + if( isset( $result->ts_tags ) ) { list( $tagDisplay, $newClasses ) = ChangeTags::formatSummaryRow( $result->ts_tags, 'newpages' ); $classes = array_merge( $classes, $newClasses ); } else { @@ -530,7 +530,7 @@ class NewPagesPager extends ReverseChronologicalPager { $fields = array( 'rc_namespace', 'rc_title', 'rc_cur_id', 'rc_user', 'rc_user_text', 'rc_comment', 'rc_timestamp', 'rc_patrolled','rc_id', 'rc_deleted', - 'length' => 'page_len', 'rev_id' => 'page_latest', 'ts_tags', 'rc_this_oldid', + 'length' => 'page_len', 'rev_id' => 'page_latest', 'rc_this_oldid', 'page_namespace', 'page_title' ); $join_conds = array( 'page' => array( 'INNER JOIN', 'page_id=rc_cur_id' ) ); @@ -546,13 +546,10 @@ class NewPagesPager extends ReverseChronologicalPager { 'join_conds' => $join_conds ); - // Empty array for fields, it'll be set by us anyway. - $fields = array(); - // Modify query for tags ChangeTags::modifyDisplayQuery( $info['tables'], - $fields, + $info['fields'], $info['conds'], $info['join_conds'], $info['options'], diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index ec8f93b587..2bd8b0a96d 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -396,14 +396,15 @@ class SpecialRecentChanges extends IncludableSpecialPage { $fields[] = 'page_latest'; $join_conds['page'] = array('LEFT JOIN', 'rc_cur_id=page_id'); } - if ( !$this->including() ) { - // Tag stuff. - // Doesn't work when transcluding. See bug 23293 - ChangeTags::modifyDisplayQuery( - $tables, $fields, $conds, $join_conds, $query_options, - $opts['tagfilter'] - ); - } + // Tag stuff. + ChangeTags::modifyDisplayQuery( + $tables, + $fields, + $conds, + $join_conds, + $query_options, + $opts['tagfilter'] + ); if ( !wfRunHooks( 'SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$fields ) ) ) diff --git a/includes/specials/SpecialRecentchangeslinked.php b/includes/specials/SpecialRecentchangeslinked.php index 9010e1018e..862736d3f8 100644 --- a/includes/specials/SpecialRecentchangeslinked.php +++ b/includes/specials/SpecialRecentchangeslinked.php @@ -110,10 +110,14 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges { $join_conds['page'] = array('LEFT JOIN', 'rc_cur_id=page_id'); $select[] = 'page_latest'; } - if ( !$this->including() ) { // bug 23293 - ChangeTags::modifyDisplayQuery( $tables, $select, $conds, $join_conds, - $query_options, $opts['tagfilter'] ); - } + ChangeTags::modifyDisplayQuery( + $tables, + $select, + $conds, + $join_conds, + $query_options, + $opts['tagfilter'] + ); if ( !wfRunHooks( 'SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$select ) ) ) { return false; -- 2.20.1