Skip to content

Fix: null author locale when saving new content#3697

Open
MrWeb wants to merge 1 commit intobolt:6.0from
MrWeb:fix/null-author-locale
Open

Fix: null author locale when saving new content#3697
MrWeb wants to merge 1 commit intobolt:6.0from
MrWeb:fix/null-author-locale

Conversation

@MrWeb
Copy link
Copy Markdown

@MrWeb MrWeb commented Apr 4, 2026

Summary

  • Fix fatal error Call to a member function getLocale() on null when saving a new content record in the backend
  • When $originalContent is null (new record), $originalAuthor is null — falls back to $request->getLocale() instead of crashing

Fixes #3696

Test plan

  • Create a new content record of any content type
  • Fill in required fields and click Save
  • Verify it saves without 500 error
  • Verify editing an existing record still works correctly

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 bolt#3696
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Call to getLocale() on null originalAuthor when saving new content

1 participant