From 431486e7009b0a33c17f72ffa63d4db3e8f16610 Mon Sep 17 00:00:00 2001 From: "Mr.Web" Date: Sat, 4 Apr 2026 14:33:39 +0200 Subject: [PATCH] Fix null author locale when saving new content When creating a new content record, $originalAuthor is null because there is no original content to get the author from. This causes a fatal error at line 184 when calling ->getLocale() on null. Falls back to the request locale when originalAuthor is null. Fixes #3696 --- src/Controller/Backend/ContentEditController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/Backend/ContentEditController.php b/src/Controller/Backend/ContentEditController.php index 6129435c6..c9c26fc1d 100644 --- a/src/Controller/Backend/ContentEditController.php +++ b/src/Controller/Backend/ContentEditController.php @@ -181,7 +181,7 @@ public function save(Request $request, ?Content $originalContent = null, ?Conten $event = new ContentEvent($content); $this->dispatcher->dispatch($event, ContentEvent::POST_SAVE); - $locale = $originalAuthor->getLocale(); + $locale = $originalAuthor ? $originalAuthor->getLocale() : $request->getLocale(); // If we're "Saving Ajaxy" if ($request->isXmlHttpRequest()) {