Revert "Fix that when chosing to not to store preferences an invalid config is created"

This reverts commit 6284da451e.
This commit is contained in:
Johannes Meyer 2015-01-23 15:23:43 +01:00
parent 6284da451e
commit 14a4aaeb77
3 changed files with 7 additions and 6 deletions

View File

@ -48,13 +48,13 @@ class ApplicationConfigForm extends Form
'select',
'preferences_type',
array(
'allowEmpty' => true,
'required' => true,
'autosubmit' => true,
'label' => $this->translate('User Preference Storage Type'),
'multiOptions' => array(
'ini' => $this->translate('File System (INI Files)'),
'db' => $this->translate('Database'),
'' => $this->translate('Don\'t Store Preferences')
'null' => $this->translate('Don\'t Store Preferences')
)
)
);

View File

@ -63,10 +63,11 @@ class Manager
);
$config = new Config();
}
if ($config->get('preferences', 'type')) {
if ($config->hasSection('preferences')) {
$preferencesConfig = $config->getSection('preferences');
try {
$preferencesStore = PreferencesStore::create(
$config->getSection('preferences'),
$preferencesConfig,
$user
);
$preferences = new Preferences($preferencesStore->load());

View File

@ -66,13 +66,13 @@ class PreferencesPage extends Form
if (Platform::hasMysqlSupport() || Platform::hasPostgresqlSupport()) {
$storageTypes['db'] = $this->translate('Database');
}
$storageTypes[''] = $this->translate('Don\'t Store Preferences');
$storageTypes['null'] = $this->translate('Don\'t Store Preferences');
$this->addElement(
'select',
'type',
array(
'allowEmpty' => true,
'required' => true,
'label' => $this->translate('User Preference Storage Type'),
'multiOptions' => $storageTypes
)