Pmiazga has uploaded a new change for review. (
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(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups
refs/changes/31/328431/1
diff --git a/includes/PopupsContext.php b/includes/PopupsContext.php
index bd8fb69..f64d780 100644
--- a/includes/PopupsContext.php
+++ b/includes/PopupsContext.php
@@ -119,7 +119,7 @@
*/
public function isEnabledByUser( \User $user ) {
if ( $user->isAnon() ) {
- return false;
+ return true;
}
if ( $this->isBetaModeOn() ) {
return \BetaFeatures::isFeatureEnabled( $user,
self::PREVIEWS_BETA_PREFERENCE_NAME );
diff --git a/tests/phpunit/PopupsContextTest.php
b/tests/phpunit/PopupsContextTest.php
index bcd3ea6..2ef1b6c 100644
--- a/tests/phpunit/PopupsContextTest.php
+++ b/tests/phpunit/PopupsContextTest.php
@@ -163,13 +163,13 @@
$user = $this->getMutableTestUser()->getUser();
$user->setId( self::ANONYMOUS_USER );
$user->setOption( PopupsContext::PREVIEWS_OPTIN_PREFERENCE_NAME,
- PopupsContext::PREVIEWS_ENABLED );
+ PopupsContext::PREVIEWS_DISABLED );
$this->setMwGlobals( [
"wgPopupsBetaFeature" => false
] );
$context = PopupsContext::getInstance();
- $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: newchange
Gerrit-Change-Id: I11dc6208334daa556d376f04aeb099a2642fcec0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: mpga
Gerrit-Owner: Pmiazga <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits