fix: [settings] Fixed missing error when evaluating parent settings
parent
b75cdac42b
commit
a82c8fe62b
|
@ -50,7 +50,12 @@ class SettingsTable extends AppTable
|
|||
$errors = [];
|
||||
$setting = $this->getSetting($name);
|
||||
$value = $this->normaliseValue($value, $setting);
|
||||
if (!empty($setting['beforeSave'])) {
|
||||
if ($setting['type'] == 'select') {
|
||||
if (!in_array($value, array_keys($setting['options']))) {
|
||||
$errors[] = __('Invalid option provided');
|
||||
}
|
||||
}
|
||||
if (empty($errors) && !empty($setting['beforeSave'])) {
|
||||
$setting['value'] = $value ?? '';
|
||||
$beforeSaveResult = $this->SettingsProvider->evaluateFunctionForSetting($setting['beforeSave'], $setting);
|
||||
if ($beforeSaveResult !== true) {
|
||||
|
|
Loading…
Reference in New Issue