From a9b0a70155eb46fd659893fa6f42cdf28aad5bf7 Mon Sep 17 00:00:00 2001 From: Niklas Forsdahl Date: Tue, 7 May 2024 18:20:56 +0300 Subject: [PATCH] Throw 404 error on grid field nested form move-to-parent action, if no record is found. --- src/GridFieldNestedForm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GridFieldNestedForm.php b/src/GridFieldNestedForm.php index a569b3c..cb3015c 100644 --- a/src/GridFieldNestedForm.php +++ b/src/GridFieldNestedForm.php @@ -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