Enable Reference Previews for more users

Registered users see reference previews by default, and anonymous
users by default when not in beta feature mode.

Cherry-picked from I28c43ab3348ffdc27b068fc1ac1d6a6a06ee90a6
and 1fce62ca7b.

The behavior for PagePreviews – implemented years ago – was
different. For old users it was disabled by default. This
behavior is wrong for ReferencePreviews.

Bug: T271206
Change-Id: I28c43ab3348ffdc27b068fc1ac1d6a6a06ee90a6
This commit is contained in:
Thiemo Kreuz 2021-05-05 14:28:38 +02:00 committed by Adam Wight
parent a438b641c8
commit 8f1f7f2095
2 changed files with 7 additions and 1 deletions

View file

@ -158,6 +158,12 @@ class PopupsContext {
self::REFERENCE_PREVIEWS_PREFERENCE_NAME
);
}
// if not in Beta then enable for anonymous users
if ( $user->isAnon() ) {
return true;
}
return $user->getBoolOption( self::REFERENCE_PREVIEWS_PREFERENCE_NAME_AFTER_BETA );
}

View file

@ -224,7 +224,7 @@ class PopupsHooks {
if ( $config->get( 'PopupsReferencePreviews' ) &&
!$config->get( 'PopupsReferencePreviewsBetaFeature' )
) {
$defaultOptions[PopupsContext::REFERENCE_PREVIEWS_PREFERENCE_NAME_AFTER_BETA] = $default;
$defaultOptions[PopupsContext::REFERENCE_PREVIEWS_PREFERENCE_NAME_AFTER_BETA] = '1';
}
}