Fix exception in admin when current language is deleted#3790
Merged
tvdeyen merged 1 commit intoAlchemyCMS:mainfrom Mar 26, 2026
Merged
Fix exception in admin when current language is deleted#3790tvdeyen merged 1 commit intoAlchemyCMS:mainfrom
tvdeyen merged 1 commit intoAlchemyCMS:mainfrom
Conversation
This fixes a situation where the session contains a language id for a language that no longer exists because it has been deleted. This commit fixes this in two ways: - when deleting the language, it is removed from the session if the language is identical - when trying to get the language from the session id, the lookup code now falls back to the default language if it can't be found. This is meant to fix the scenario where a different user deletes the language instead of the user with the language id in the session I believe both fixes are useful. I've tried to come up with meaningful tests but I am somewhat unfamiliar with the codebase so feel free to suggest extra things. A backport to Alchemy 7 would be appreciated if possible, as it will probably still take us a while to get to 8.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3790 +/- ##
=======================================
Coverage 97.48% 97.48%
=======================================
Files 320 320
Lines 8494 8497 +3
=======================================
+ Hits 8280 8283 +3
Misses 214 214 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
tvdeyen
approved these changes
Mar 26, 2026
Member
tvdeyen
left a comment
There was a problem hiding this comment.
Thanks! Very much appreciated. Back porting to 7.4 if this helps.
This was referenced Mar 26, 2026
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this pull request for?
This fixes a situation where the session contains a language id for a language that no longer exists because it has been deleted.
Notable changes (remove if none)
This commit fixes this in two ways:
I believe both fixes are useful.
I've tried to come up with meaningful tests but I am somewhat unfamiliar with the codebase so feel free to suggest extra things.
A backport to Alchemy 7 would be appreciated if possible, as it will probably still take us a while to get to 8.
Checklist