Unexpected locale fallback to first-defined portal localization in Sulu webspace resolution
0 reputation · 02 Sept 2021, 16:56 UTC
0 reputation · 02 Sept 2021, 16:56 UTC
Sulu resolves content through a webspace → portal → localization hierarchy. When a request locale does not match any portal localization, the system silently falls back to the first localization defined in that portal’s localizations array.
The admin UI “Default” checkbox on a localization affects only content-editing preselection, not frontend resolution. Editors expect the flagged localization to serve as the fallback, but the hard-coded strategy uses array order instead. This behavior is documented but non-obvious, and no configuration option or event hook exists to change the fallback strategy (e.g., to prefer a specific locale, log the fallback, or return 404) without overriding core controller services.
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.