Skip to content

Commit

Permalink
Throw 404 error on grid field nested form move-to-parent action,
Browse files Browse the repository at this point in the history
if no record is found.
  • Loading branch information
forsdahl committed May 7, 2024
1 parent 8f50565 commit a9b0a70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/GridFieldNestedForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public function handleMoveToParent(GridField $gridField, $request): string
$list = $gridField->getList();
$id = isset($move['id']) ? (int) $move['id'] : null;
if (!$id) {
throw new HTTPResponse_Exception('Missing ID', 400);
throw new HTTPResponse_Exception('Missing ID', 404);
}
$to = isset($move['parent']) ? (int)$move['parent'] : null;
// should be possible either on parent or child grid field, or nested grid field from parent
Expand Down

0 comments on commit a9b0a70

Please sign in to comment.