From 82f3aeb23c39a4566a4e9f0e1130a32ad1e37709 Mon Sep 17 00:00:00 2001 From: Thomas Weinert Date: Wed, 21 Oct 2020 16:37:42 +0200 Subject: [PATCH] [FIX] Fix Saving New Settings --- .../Settings/Commands/EditSetting.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/system/Papaya/Administration/Settings/Commands/EditSetting.php b/src/system/Papaya/Administration/Settings/Commands/EditSetting.php index cc3fe05a..4fa09c55 100644 --- a/src/system/Papaya/Administration/Settings/Commands/EditSetting.php +++ b/src/system/Papaya/Administration/Settings/Commands/EditSetting.php @@ -54,8 +54,18 @@ public function createDialog() { ] ); $dialog->caption = new TranslatedText('Edit Setting'); - $dialog->data()->merge($this->record()); - $currentValue = $this->record()->value; + if ($this->record()->isLoaded()) { + $dialog->data()->merge($this->record()); + $currentValue = $this->record()->value; + } else { + $currentValue = $this->papaya()->options->get($settingName); + $dialog->data()->merge( + [ + 'name' => $settingName, + 'value' => $currentValue + ] + ); + } if ($profile = $this->groups()->getProfile($settingName)) { $dialog->fields[] = $field = new Dialog\Field\Sheet(); $sheet = $field->sheet();