Skip to content

Commit

Permalink
[FIX] Fix Saving New Settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasWeinert committed Oct 21, 2020
1 parent abbc707 commit 82f3aeb
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/system/Papaya/Administration/Settings/Commands/EditSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 82f3aeb

Please sign in to comment.