use Parser;
use ParserOptions;
use PreferencesForm;
+use Psr\Log\LoggerAwareTrait;
+use Psr\Log\NullLogger;
use Skin;
use SpecialPage;
use Status;
* This is the default implementation of PreferencesFactory.
*/
class DefaultPreferencesFactory implements PreferencesFactory {
+ use LoggerAwareTrait;
/** @var Config */
protected $config;
$this->contLang = $contLang;
$this->authManager = $authManager;
$this->linkRenderer = $linkRenderer;
+ $this->logger = new NullLogger();
}
/**
Hooks::run( 'GetPreferences', [ $user, &$preferences ] );
$this->loadPreferenceValues( $user, $context, $preferences );
+ $this->logger->debug( "Created form descriptor for user '{$user->getName()}'" );
return $preferences;
}
'section' => 'watchlist/advancedwatchlist',
'label-message' => 'tog-watchlisthideliu',
];
- $defaultPreferences['watchlistreloadautomatically'] = [
- 'type' => 'toggle',
- 'section' => 'watchlist/advancedwatchlist',
- 'label-message' => 'tog-watchlistreloadautomatically',
- ];
+
+ if ( !\SpecialWatchlist::checkStructuredFilterUiEnabled(
+ $this->config,
+ $user
+ ) ) {
+ $defaultPreferences['watchlistreloadautomatically'] = [
+ 'type' => 'toggle',
+ 'section' => 'watchlist/advancedwatchlist',
+ 'label-message' => 'tog-watchlistreloadautomatically',
+ ];
+ }
+
$defaultPreferences['watchlistunwatchlinks'] = [
'type' => 'toggle',
'section' => 'watchlist/advancedwatchlist',