jenkins-bot has submitted this change and it was merged. Change subject: Migrate TranslateRcFilter::translationFilter to ChangesListSpecialPageQuery hook ......................................................................
Migrate TranslateRcFilter::translationFilter to ChangesListSpecialPageQuery hook Bug: T67776 Change-Id: Ia00a3fe79791f0372f17cbdd0e6f7291a2f9be11 --- M Translate.php M utils/RcFilter.php 2 files changed, 13 insertions(+), 4 deletions(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/Translate.php b/Translate.php index ac74168..abdfe6e 100644 --- a/Translate.php +++ b/Translate.php @@ -126,7 +126,7 @@ $wgHooks['GetPreferences'][] = 'TranslatePreferences::translationAssistLanguages'; // Recent changes filters -$wgHooks['SpecialRecentChangesQuery'][] = 'TranslateRcFilter::translationFilter'; +$wgHooks['ChangesListSpecialPageQuery'][] = 'TranslateRcFilter::translationFilter'; $wgHooks['SpecialRecentChangesPanel'][] = 'TranslateRcFilter::translationFilterForm'; $wgHooks['SkinTemplateToolboxEnd'][] = 'TranslateToolbox::toolboxAllTranslations'; $wgHooks['AbortEmailNotification'][] = 'TranslateHooks::onAbortEmailNotificationReview'; diff --git a/utils/RcFilter.php b/utils/RcFilter.php index 8dbda19..dd2d7f8 100644 --- a/utils/RcFilter.php +++ b/utils/RcFilter.php @@ -15,19 +15,28 @@ */ class TranslateRcFilter { /** - * Hooks SpecialRecentChangesQuery. See the hook documentation for + * Hooks ChangesListSpecialPageQuery. See the hook documentation for * documentation of the function parameters. * * Appends SQL filter conditions into $conds. + * @param string $pageName + * @param array $tables + * @param array $fields * @param array $conds - * @param array|string $tables + * @param array $query_options * @param array $join_conds * @param FormOptions $opts * @return bool true */ - public static function translationFilter( &$conds, &$tables, &$join_conds, $opts ) { + public static function translationFilter( $pageName, &$tables, &$fields, &$conds, &$query_options, + &$join_conds, FormOptions $opts + ) { global $wgTranslateMessageNamespaces, $wgTranslateRcFilterDefault; + if ( $pageName !== 'Recentchanges' ) { + return true; + } + $request = RequestContext::getMain()->getRequest(); $translations = $request->getVal( 'translations', $wgTranslateRcFilterDefault ); $opts->add( 'translations', $wgTranslateRcFilterDefault ); -- To view, visit https://gerrit.wikimedia.org/r/286292 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia00a3fe79791f0372f17cbdd0e6f7291a2f9be11 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Glaisher <glaisher.w...@gmail.com> Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits