mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 14:54:24 +02:00
Fix that when chosing to not to store preferences an invalid config is created
fixes #8234
This commit is contained in:
parent
c78d4aa0bd
commit
6284da451e
@ -48,13 +48,13 @@ class ApplicationConfigForm extends Form
|
|||||||
'select',
|
'select',
|
||||||
'preferences_type',
|
'preferences_type',
|
||||||
array(
|
array(
|
||||||
'required' => true,
|
'allowEmpty' => true,
|
||||||
'autosubmit' => true,
|
'autosubmit' => true,
|
||||||
'label' => $this->translate('User Preference Storage Type'),
|
'label' => $this->translate('User Preference Storage Type'),
|
||||||
'multiOptions' => array(
|
'multiOptions' => array(
|
||||||
'ini' => $this->translate('File System (INI Files)'),
|
'ini' => $this->translate('File System (INI Files)'),
|
||||||
'db' => $this->translate('Database'),
|
'db' => $this->translate('Database'),
|
||||||
'null' => $this->translate('Don\'t Store Preferences')
|
'' => $this->translate('Don\'t Store Preferences')
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -63,11 +63,10 @@ class Manager
|
|||||||
);
|
);
|
||||||
$config = new Config();
|
$config = new Config();
|
||||||
}
|
}
|
||||||
if ($config->hasSection('preferences')) {
|
if ($config->get('preferences', 'type')) {
|
||||||
$preferencesConfig = $config->getSection('preferences');
|
|
||||||
try {
|
try {
|
||||||
$preferencesStore = PreferencesStore::create(
|
$preferencesStore = PreferencesStore::create(
|
||||||
$preferencesConfig,
|
$config->getSection('preferences'),
|
||||||
$user
|
$user
|
||||||
);
|
);
|
||||||
$preferences = new Preferences($preferencesStore->load());
|
$preferences = new Preferences($preferencesStore->load());
|
||||||
|
@ -66,13 +66,13 @@ class PreferencesPage extends Form
|
|||||||
if (Platform::hasMysqlSupport() || Platform::hasPostgresqlSupport()) {
|
if (Platform::hasMysqlSupport() || Platform::hasPostgresqlSupport()) {
|
||||||
$storageTypes['db'] = $this->translate('Database');
|
$storageTypes['db'] = $this->translate('Database');
|
||||||
}
|
}
|
||||||
$storageTypes['null'] = $this->translate('Don\'t Store Preferences');
|
$storageTypes[''] = $this->translate('Don\'t Store Preferences');
|
||||||
|
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
'select',
|
'select',
|
||||||
'type',
|
'type',
|
||||||
array(
|
array(
|
||||||
'required' => true,
|
'allowEmpty' => true,
|
||||||
'label' => $this->translate('User Preference Storage Type'),
|
'label' => $this->translate('User Preference Storage Type'),
|
||||||
'multiOptions' => $storageTypes
|
'multiOptions' => $storageTypes
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user