From a50e5c6fd6af7deabf8739c8c798cb5647bbc364 Mon Sep 17 00:00:00 2001 From: Matthew Flaschen Date: Thu, 22 May 2014 03:04:41 -0400 Subject: [PATCH] Preserve veaction, vesection on special redirects to wiki pages Bug: 50877 Change-Id: I61fcc9109105ea25f30f89ec18d8fa0d13dcde82 --- VisualEditor.hooks.php | 11 +++++++++++ VisualEditor.php | 2 ++ 2 files changed, 13 insertions(+) diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php index df50dd85c3..a79b6e4f22 100644 --- a/VisualEditor.hooks.php +++ b/VisualEditor.hooks.php @@ -665,4 +665,15 @@ class VisualEditorHooks { public static function onParserTestGlobals( array &$settings ) { $settings['wgVisualEditorInParserTests'] = true; } + + /** + * @param Array $redirectParams Parameters preserved on special page redirects + * to wiki pages + * @return bool Always true + */ + public static function onRedirectSpecialArticleRedirectParams( &$redirectParams ) { + array_push( $redirectParams, 'veaction', 'vesection' ); + + return true; + } } diff --git a/VisualEditor.php b/VisualEditor.php index ab37eb8ce6..4d2e5498f8 100644 --- a/VisualEditor.php +++ b/VisualEditor.php @@ -60,6 +60,8 @@ $wgHooks['GetBetaFeaturePreferences'][] = 'VisualEditorHooks::onGetBetaPreferenc $wgHooks['GetPreferences'][] = 'VisualEditorHooks::onGetPreferences'; $wgHooks['ListDefinedTags'][] = 'VisualEditorHooks::onListDefinedTags'; $wgHooks['MakeGlobalVariablesScript'][] = 'VisualEditorHooks::onMakeGlobalVariablesScript'; +$wgHooks['RedirectSpecialArticleRedirectParams'][] = + 'VisualEditorHooks::onRedirectSpecialArticleRedirectParams'; $wgHooks['ResourceLoaderGetConfigVars'][] = 'VisualEditorHooks::onResourceLoaderGetConfigVars'; $wgHooks['ResourceLoaderRegisterModules'][] = 'VisualEditorHooks::onResourceLoaderRegisterModules'; $wgHooks['ResourceLoaderTestModules'][] = 'VisualEditorHooks::onResourceLoaderTestModules';