Skip to content

Commit

Permalink
#367 - AdminUI edit properties treats "new" id value as zero or empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
maraf committed Oct 5, 2021
1 parent 8bdcaaa commit b42b465
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/app/scripts/php/libs/AdminUi.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public function edit($template, $id) {
$this->edit["id"] = $id;
$this->edit["isEdit"] = true;
if ($id == "new") {
$this->edit["id"] = 0;
$this->edit["isNew"] = true;
$this->edit["title"] = "Create";
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/app/scripts/php/libs/Language.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function form($template, $id = 0) {
$model = parent::getEditModel();

if (!$model->hasMetadataKey("isUpdate")) {
$isUpdate = !empty($id) && $id != "new";
$isUpdate = !empty($id);
$model->metadata("isUpdate", $isUpdate);
} else {
$isUpdate = $model->metadata("isUpdate");
Expand Down

0 comments on commit b42b465

Please sign in to comment.