jenkins-bot has submitted this change and it was merged.
Change subject: Preserve the 'tour' parameter on special page redirects.
......................................................................
Preserve the 'tour' parameter on special page redirects.
Bug: 45219
Change-Id: Ifab3511425ba50fa0f3e0dbc9ba0975eb6a35b9e
---
M GuidedTour.php
M GuidedTourHooks.php
2 files changed, 9 insertions(+), 1 deletion(-)
Approvals:
Ori.livneh: Looks good to me, approved
jenkins-bot: Verified
diff --git a/GuidedTour.php b/GuidedTour.php
index c60312e..4318d00 100644
--- a/GuidedTour.php
+++ b/GuidedTour.php
@@ -36,6 +36,7 @@
$wgHooks['BeforePageDisplay'][] = 'GuidedTourHooks::onBeforePageDisplay';
$wgHooks['MakeGlobalVariablesScript'][] =
'GuidedTourHooks::onMakeGlobalVariablesScript';
$wgHooks['ResourceLoaderTestModules'][] =
'GuidedTourHooks::onResourceLoaderTestModules';
+$wgHooks['RedirectSpecialArticleRedirectParams'][] =
'GuidedTourHooks::onRedirectSpecialArticleRedirectParams';
// Extension credits that will show up on Special:Version
$wgExtensionCredits['other'][] = array(
diff --git a/GuidedTourHooks.php b/GuidedTourHooks.php
index 72e87ec..de40d41 100644
--- a/GuidedTourHooks.php
+++ b/GuidedTourHooks.php
@@ -17,6 +17,9 @@
// Tour cookie name. It will be prefixed automatically.
const COOKIE_NAME = '-mw-tour';
+
+ const TOUR_PARAM = 'tour';
+
/*
XXX (mattflaschen, 2012-01-02):
@@ -125,7 +128,7 @@
global $wgResourceModules;
// test for tour enabled in url first
$request = $out->getRequest();
- $queryTourName = $request->getVal('tour');
+ $queryTourName = $request->getVal( self::TOUR_PARAM );
if ( $queryTourName !== null ) {
self::addTour( $out, $queryTourName );
} else {
@@ -153,4 +156,8 @@
return true;
}
+ public static function onRedirectSpecialArticleRedirectParams(
&$redirectParams ) {
+ $redirectParams[] = self::TOUR_PARAM;
+ return TRUE;
+ }
}
--
To view, visit https://gerrit.wikimedia.org/r/55445
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifab3511425ba50fa0f3e0dbc9ba0975eb6a35b9e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GuidedTour
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: Swalling <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits