mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
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:
parent
4269d65868
commit
f6fe40b500
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue