From 142916523169222102d0cac38fced0d965fb8fc9 Mon Sep 17 00:00:00 2001 From: storbahn Date: Thu, 11 Sep 2025 15:18:32 +0200 Subject: [PATCH] Fix error of reset editables AI: Ambiguous Intent: Passing null to setEditables() is not self-documenting. It's unclear if null means "clear all editables," "reset," or "remove references." Type Safety: If setEditables() expects an array or iterable, passing null can lead to subtle bugs, especially if the internal implementation doesn't explicitly handle null. Inconsistent Usage: Elsewhere in the code (e.g., changeMainDocumentAction), editables are cleared with an empty array: $doc->setEditables([]);. Mixing null and [] for the same effect is inconsistent. --- src/Controller/Admin/Document/DocumentControllerBase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/Admin/Document/DocumentControllerBase.php b/src/Controller/Admin/Document/DocumentControllerBase.php index 189d2caa06..112126c81d 100644 --- a/src/Controller/Admin/Document/DocumentControllerBase.php +++ b/src/Controller/Admin/Document/DocumentControllerBase.php @@ -180,7 +180,7 @@ interface_exists(TargetingDocumentInterface::class) $document->getEditables(); } else { // ensure no editables (e.g. from session, version, ...) are still referenced - $document->setEditables(null); + $document->setEditables([]); } if ($request->get('data')) {