jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/328431 )

Change subject: ext.popups module should be loaded for anon users
......................................................................


ext.popups module should be loaded for anon users

Bug: T146889
Change-Id: I11dc6208334daa556d376f04aeb099a2642fcec0
---
M includes/PopupsContext.php
M tests/phpunit/PopupsContextTest.php
2 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  jenkins-bot: Verified
  Phuedx: Looks good to me, approved



diff --git a/includes/PopupsContext.php b/includes/PopupsContext.php
index 8f77c8d..b2c407f 100644
--- a/includes/PopupsContext.php
+++ b/includes/PopupsContext.php
@@ -91,7 +91,7 @@
         */
        public function isEnabledByUser( \User $user ) {
                if ( $user->isAnon() ) {
-                       return false;
+                       return true;
                }
                if ( $this->config->get( 'PopupsBetaFeature' ) ) {
                        if ( !class_exists( 'BetaFeatures' ) ) {
diff --git a/tests/phpunit/PopupsContextTest.php 
b/tests/phpunit/PopupsContextTest.php
index b584414..82d43ab 100644
--- a/tests/phpunit/PopupsContextTest.php
+++ b/tests/phpunit/PopupsContextTest.php
@@ -123,13 +123,13 @@
                $user = $this->getMutableTestUser()->getUser();
                $user->setId( 0 );
                $user->setOption( PopupsContext::PREVIEWS_OPTIN_PREFERENCE_NAME,
-                       PopupsContext::PREVIEWS_ENABLED );
+                       PopupsContext::PREVIEWS_DISABLED );
                $this->setMwGlobals( [
                        "wgPopupsBetaFeature" => false
                ] );
 
                $context = new PopupsContext();
-               $this->assertEquals( false, $context->isEnabledByUser( $user ) 
);
+               $this->assertEquals( true, $context->isEnabledByUser( $user ) );
        }
        /**
         * @return array/

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I11dc6208334daa556d376f04aeb099a2642fcec0
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: mpga
Gerrit-Owner: Pmiazga <[email protected]>
Gerrit-Reviewer: Phuedx <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to