Skip to content

Commit

Permalink
41191: insert an item group causes error
Browse files Browse the repository at this point in the history
  • Loading branch information
alex40724 committed Apr 22, 2024
1 parent d8dec2e commit 6037307
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions Services/COPage/PC/Resources/ResourcesCommandActionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,31 @@ protected function insertCommand(array $body): Server\Response

$res_type = $body["res_type"];

$invalid = false;
if ($res_type === "_other") {
$res->setResourceListType("_other");
} elseif ($res_type === "_lobj") {
$res->setResourceListType("_lobj");
} elseif ($res_type !== "itgr") {
$res->setResourceListType(
$body["type"]
);
if (isset($body["type"])) {
$res->setResourceListType(
$body["type"]
);
} else {
$invalid = true;
}
} else {
$res->setItemGroupRefId(
$body["itgr"]
(int) $body["itgr"]
);
}

$updated = $page->update();
if (!$invalid) {
$updated = $page->update();
} else {
$page->buildDom(true); // rebuild dom (remove changes)
$updated = true;
}

return $this->ui_wrapper->sendPage($this->page_gui, $updated);
}
Expand Down

0 comments on commit 6037307

Please sign in to comment.