Throw 404 error on grid field nested form move-to-parent action,

if no record is found.
This commit is contained in:
Niklas Forsdahl 2024-05-07 18:20:56 +03:00
parent 8f505659f0
commit a9b0a70155
1 changed files with 1 additions and 1 deletions

View File

@ -288,7 +288,7 @@ class GridFieldNestedForm extends AbstractGridFieldComponent implements
$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