Merge "PreferenceHooks: Avoid referring to the field of disabled feature"

This commit is contained in:
jenkins-bot 2022-09-24 23:30:44 +00:00 committed by Gerrit Code Review
commit fb7a25ce91

View file

@ -125,7 +125,10 @@ class PreferenceHooks implements
// (both reply tool and new topic tool are disabled)
$preferences['discussiontools-' . HookUtils::SOURCEMODETOOLBAR]['disable-if'] = [ 'AND' ];
if ( isset( $preferences['discussiontools-' . HookUtils::REPLYTOOL] ) ) {
if ( isset( $preferences['discussiontools-' . HookUtils::REPLYTOOL] ) &&
// GlobalPreferences extension would delete disabled fields, avoid referring to it.
!( $preferences['discussiontools-' . HookUtils::REPLYTOOL]['disabled'] ?? false )
) {
$preferences['discussiontools-' . HookUtils::SOURCEMODETOOLBAR]['disable-if'][] = [
'===', 'discussiontools-' . HookUtils::REPLYTOOL, ''
];