SettingsForm: do not expect enum to contain...

...the default value

fixes #1054
This commit is contained in:
Thomas Gelf 2017-08-02 15:54:03 +02:00
parent b7579e184c
commit 7c47b5a8d1
1 changed files with 8 additions and 4 deletions

View File

@ -138,12 +138,16 @@ class SettingsForm extends DirectorForm
protected function eventuallyConfiguredEnum($name, $enum)
{
return array(
null => sprintf(
if (array_key_exists($name, $enum)) {
$default = sprintf(
$this->translate('%s (default)'),
$enum[$this->settings->getDefaultValue($name)]
)
) + $enum;
);
} else {
$default = $this->translate('- please choose -');
}
return [null => $default] + $enum;
}
public function setSettings(Settings $settings)