From a4a4e794aa2b287f2d95dbc1587d1bbf9e618dd3 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Fri, 23 Jul 2010 22:37:52 +0000 Subject: [PATCH] (bug 23293) Don't show change tags when special:rc/rclinked/newpages is transcluded into another page as it causes UNIQ... to be everywhere. --- RELEASE-NOTES | 3 +++ includes/specials/SpecialNewpages.php | 10 +++++++--- includes/specials/SpecialRecentchanges.php | 15 +++++++++------ includes/specials/SpecialRecentchangeslinked.php | 7 ++++--- 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e8ec3bbbea..996ab9e3eb 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -244,6 +244,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN namespace rename. * Make wfTimestamp recognize negative unix timestamp values. * (bug 24401) SimpleSearch: No button/text indicating 'Search' if image is disabled +* (bug 23293) Do not show change tags when special:recentchanges(linked) + or special:newpages is transcluded into another page as it messes up the + page. === API changes in 1.17 === * (bug 22738) Allow filtering by action type on query=logevent. diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index 6c9990f299..7f755a8dce 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -295,9 +295,13 @@ class SpecialNewpages extends IncludableSpecialPage { if ( $this->patrollable( $result ) ) $classes[] = 'not-patrolled'; - # Tags, if any. - list( $tagDisplay, $newClasses ) = ChangeTags::formatSummaryRow( $result->ts_tags, 'newpages' ); - $classes = array_merge( $classes, $newClasses ); + # Tags, if any. check for including due to bug 23293 + if ( !$this->including() ) { + list( $tagDisplay, $newClasses ) = ChangeTags::formatSummaryRow( $result->ts_tags, 'newpages' ); + $classes = array_merge( $classes, $newClasses ); + } else { + $tagDisplay = ''; + } $css = count($classes) ? ' class="'.implode( " ", $classes).'"' : ''; diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 2aa35b5256..4103b98987 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -318,12 +318,15 @@ class SpecialRecentChanges extends IncludableSpecialPage { $tables[] = 'page'; $join_conds['page'] = array('LEFT JOIN', 'rc_cur_id=page_id'); } - // Tag stuff. - $fields = array(); - // Fields are * in this case, so let the function modify an empty array to keep it happy. - ChangeTags::modifyDisplayQuery( - $tables, $fields, $conds, $join_conds, $query_options, $opts['tagfilter'] - ); + if ( !$this->including() ) { + // Tag stuff. + // Doesn't work when transcluding. See bug 23293 + $fields = array(); + // Fields are * in this case, so let the function modify an empty array to keep it happy. + ChangeTags::modifyDisplayQuery( + $tables, $fields, $conds, $join_conds, $query_options, $opts['tagfilter'] + ); + } if ( !wfRunHooks( 'SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts, &$query_options ) ) ) return false; diff --git a/includes/specials/SpecialRecentchangeslinked.php b/includes/specials/SpecialRecentchangeslinked.php index e72157c7af..387679fa19 100644 --- a/includes/specials/SpecialRecentchangeslinked.php +++ b/includes/specials/SpecialRecentchangeslinked.php @@ -104,9 +104,10 @@ class SpecialRecentchangeslinked extends SpecialRecentchanges { $join_conds['page'] = array('LEFT JOIN', 'rc_cur_id=page_id'); $select[] = 'page_latest'; } - - ChangeTags::modifyDisplayQuery( $tables, $select, $conds, $join_conds, - $query_options, $opts['tagfilter'] ); + if ( !$this->including() ) { // bug 23293 + ChangeTags::modifyDisplayQuery( $tables, $select, $conds, $join_conds, + $query_options, $opts['tagfilter'] ); + } // XXX: parent class does this, should we too? // wfRunHooks('SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts ) ); -- 2.20.1