Skip to content

Fix: null author locale when saving new content#3697

Open
MrWeb wants to merge 4 commits intobolt:6.0from
MrWeb:fix/null-author-locale
Open

Fix: null author locale when saving new content#3697
MrWeb wants to merge 4 commits 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
Copy link
Copy Markdown
Member

@bobvandevijver bobvandevijver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make sure that all checks (except for the cypress one, that is broken once agani) are passing?

MrWeb and others added 2 commits April 9, 2026 09:18
@MrWeb
Copy link
Copy Markdown
Author

MrWeb commented Apr 9, 2026

Dear @bobvandevijver, done, all passed buy Cypress.

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

2 participants