From 87bfd03d13ce0cc0cdd1d93538b3c42cbf628d29 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C4=9Bj=20Such=C3=A1nek?= Date: Wed, 19 Oct 2016 19:06:14 +0000 Subject: [PATCH] Provide context to ChangeTags::buildTagFilterSelector Bug: T105649 Change-Id: I5f44f4c054010c865ddb51e7d69107bdf2e88c00 --- includes/actions/HistoryAction.php | 2 +- includes/htmlform/fields/HTMLTagFilter.php | 6 ++++-- includes/logging/LogEventsList.php | 2 +- includes/specials/SpecialContributions.php | 3 ++- includes/specials/SpecialRecentchanges.php | 3 ++- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index 9573cac3ed..767a163e02 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -168,7 +168,7 @@ class HistoryAction extends FormlessAction { $year = $request->getInt( 'year' ); $month = $request->getInt( 'month' ); $tagFilter = $request->getVal( 'tagfilter' ); - $tagSelector = ChangeTags::buildTagFilterSelector( $tagFilter ); + $tagSelector = ChangeTags::buildTagFilterSelector( $tagFilter, false, $this->getContext() ); /** * Option to show only revisions that have been (partially) hidden via RevisionDelete diff --git a/includes/htmlform/fields/HTMLTagFilter.php b/includes/htmlform/fields/HTMLTagFilter.php index e24541cc84..f58acbe71b 100644 --- a/includes/htmlform/fields/HTMLTagFilter.php +++ b/includes/htmlform/fields/HTMLTagFilter.php @@ -6,7 +6,8 @@ class HTMLTagFilter extends HTMLFormField { protected $tagFilter; public function getTableRow( $value ) { - $this->tagFilter = ChangeTags::buildTagFilterSelector( $value ); + $this->tagFilter = ChangeTags::buildTagFilterSelector( + $value, false, $this->mParent->getContext() ); if ( $this->tagFilter ) { return parent::getTableRow( $value ); } @@ -14,7 +15,8 @@ class HTMLTagFilter extends HTMLFormField { } public function getDiv( $value ) { - $this->tagFilter = ChangeTags::buildTagFilterSelector( $value ); + $this->tagFilter = ChangeTags::buildTagFilterSelector( + $value, false, $this->mParent->getContext() ); if ( $this->tagFilter ) { return parent::getDiv( $value ); } diff --git a/includes/logging/LogEventsList.php b/includes/logging/LogEventsList.php index 57a7597fe4..6665336aa7 100644 --- a/includes/logging/LogEventsList.php +++ b/includes/logging/LogEventsList.php @@ -93,7 +93,7 @@ class LogEventsList extends ContextSource { // For B/C, we take strings, but make sure they are converted... $types = ( $types === '' ) ? [] : (array)$types; - $tagSelector = ChangeTags::buildTagFilterSelector( $tagFilter ); + $tagSelector = ChangeTags::buildTagFilterSelector( $tagFilter, false, $this->getContext() ); $html = Html::hidden( 'title', $title->getPrefixedDBkey() ); diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 3cd4d4dcd5..40277ca40f 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -492,7 +492,8 @@ class SpecialContributions extends IncludableSpecialPage { $form .= "\t" . Html::hidden( $name, $value ) . "\n"; } - $tagFilter = ChangeTags::buildTagFilterSelector( $this->opts['tagfilter'] ); + $tagFilter = ChangeTags::buildTagFilterSelector( + $this->opts['tagfilter'], false, $this->getContext() ); if ( $tagFilter ) { $filterSelection = Html::rawElement( diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 4569dd2601..2a93159b3b 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -501,7 +501,8 @@ class SpecialRecentChanges extends ChangesListSpecialPage { $extraOpts['category'] = $this->categoryFilterForm( $opts ); } - $tagFilter = ChangeTags::buildTagFilterSelector( $opts['tagfilter'] ); + $tagFilter = ChangeTags::buildTagFilterSelector( + $opts['tagfilter'], false, $this->getContext() ); if ( count( $tagFilter ) ) { $extraOpts['tagfilter'] = $tagFilter; } -- 2.20.1