Merge pull request #4579 from Icinga/fix/config-and-preferences-not-working-without-config-4504
Fix config and preferences not working without config
This commit is contained in:
commit
5756ebba1f
|
@ -69,7 +69,7 @@ class AccountController extends Controller
|
||||||
|
|
||||||
$form = new PreferenceForm();
|
$form = new PreferenceForm();
|
||||||
$form->setPreferences($user->getPreferences());
|
$form->setPreferences($user->getPreferences());
|
||||||
if ($config->get('config_backend', 'db') !== 'none') {
|
if ($config->get('config_backend', 'db') !== 'none' && isset($config->config_resource)) {
|
||||||
$form->setStore(PreferencesStore::create(new ConfigObject(array(
|
$form->setStore(PreferencesStore::create(new ConfigObject(array(
|
||||||
'store' => $config->get('config_backend', 'db'),
|
'store' => $config->get('config_backend', 'db'),
|
||||||
'resource' => $config->config_resource
|
'resource' => $config->config_resource
|
||||||
|
|
|
@ -42,7 +42,7 @@ class GeneralConfigForm extends ConfigForm
|
||||||
{
|
{
|
||||||
parent::onRequest();
|
parent::onRequest();
|
||||||
|
|
||||||
if ($this->config->getConfigObject()->global->config_backend === 'ini') {
|
if ($this->config->get('global', 'config_backend') === 'ini') {
|
||||||
$this->warning('The preferences backend of type INI is deprecated and will be removed with version 2.11');
|
$this->warning('The preferences backend of type INI is deprecated and will be removed with version 2.11');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue