Fix check for feature availability

If asking if any feature is available, also check if
any feature has been set to 'available'.

Change-Id: I417f8756d91c5d3abab8b24109320737b8b86509
This commit is contained in:
Ed Sanders 2021-01-13 19:30:59 +00:00
parent 4269d65868
commit f6fe40b500

View file

@ -79,9 +79,19 @@ class Hooks {
$optionsLookup = $services->getUserOptionsLookup();
// Feature-specific override
if ( $feature && $dtConfig->get( 'DiscussionTools_' . $feature ) !== 'default' ) {
// Feature setting can be 'available' or 'unavailable', overriding any BetaFeatures settings
return $dtConfig->get( 'DiscussionTools_' . $feature ) === 'available';
if ( $feature ) {
if ( $dtConfig->get( 'DiscussionTools_' . $feature ) !== 'default' ) {
// Feature setting can be 'available' or 'unavailable', overriding any BetaFeatures settings
return $dtConfig->get( 'DiscussionTools_' . $feature ) === 'available';
}
} else {
// Non-feature-specific override
if (
$dtConfig->get( 'DiscussionTools_replytool' ) === 'available' ||
$dtConfig->get( 'DiscussionTools_newtopictool' ) === 'available'
) {
return true;
}
}
// No feature-specific override found.