jenkins-bot has submitted this change and it was merged.

Change subject: Add split test with control being shown core landing page.
......................................................................


Add split test with control being shown core landing page.

Change-Id: I5b596681aff351e629475632eae8b078d5c4ccac
---
M GettingStarted.hooks.php
M SpecialGettingStarted.php
2 files changed, 12 insertions(+), 7 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/GettingStarted.hooks.php b/GettingStarted.hooks.php
index 7df019a..06fe9c4 100644
--- a/GettingStarted.hooks.php
+++ b/GettingStarted.hooks.php
@@ -64,7 +64,7 @@
        }
 
        public static function onBeforeWelcomeCreation( &$welcomeCreationMsg, 
&$injectHtml ) {
-               global $wgOut;
+               global $wgOut, $wgUser;
 
                // Do nothing on mobile.
                if ( class_exists( 'MobileContext' ) ) {
@@ -73,14 +73,18 @@
                        }
                }
 
-               // Replace default message with blank one
-               $welcomeCreationMsg = 'gettingstarted-msg';
-               $specialGS = new SpecialGettingStarted();
-               $injectHtml = $specialGS->getHtmlResult() . $injectHtml;
+               // Activate for users with even user IDs.
+               if ( ( $wgUser->getId() % 2 ) === 0 ) {
+                       // Replace default message with blank one
+                       $welcomeCreationMsg = 'gettingstarted-msg';
+                       $specialGS = new SpecialGettingStarted();
+                       $injectHtml = $specialGS->getHtmlResult() . $injectHtml;
 
-               $wgOut->addModuleStyles( 'ext.gettingstarted.styles' );
+                       // Styles are added separately so they load without 
needing JS
+                       $wgOut->addModuleStyles( 'ext.gettingstarted.styles' );
 
-               $wgOut->addModules( 'ext.gettingstarted.accountcreation' );
+                       $wgOut->addModules( 
'ext.gettingstarted.accountcreation' );
+               }
 
                return true;
        }
diff --git a/SpecialGettingStarted.php b/SpecialGettingStarted.php
index 4a39f14..5c67192 100644
--- a/SpecialGettingStarted.php
+++ b/SpecialGettingStarted.php
@@ -20,6 +20,7 @@
                        $output->setPageTitle( $this->msg( 
'gettingstarted-welcomesiteuseranon', $wgSitename ) );
                }
 
+               // Styles are added separately so they load without needing JS
                $output->addModuleStyles( 'ext.gettingstarted.styles' );
 
                $output->addModules( array(

-- 
To view, visit https://gerrit.wikimedia.org/r/53314
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5b596681aff351e629475632eae8b078d5c4ccac
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/GettingStarted
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: Spage <[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

Reply via email to