-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Localizations objects in WebRequestContext.Localization.SiteLocalizations are partially loaded #45
Comments
There is a workaround to this issue. The action and view from https://gist.github.com/jhorsman/679f6ab072c3896db41fcf893c3307b9 as mentioned in the issue description implement it. Before using a Localization objects from Localization.SiteLocalizations you can call Localization.EnsureInitialized() on ecah Localization object like so.
Mind that if the |
The |
As a further improvement, and to avoid having to handle exceptions like described in #48, DXA could load all Localization objects which cannot be loaded because the settings are not loaded are removed from the
|
I agree with the idea to suppress Localization for Publications which are not published from |
Can you also agree that the |
Yes and no. :-)
|
The Localization objects in Localization.SiteLocalizations are partially loaded. Only the Localization id and Path properties are set. Other properties like Culture and Language are not set.
When the WebRequestContext.Localization itself is loaded there is logic in place to call Localization.EnsureInitialized() which loads all the Localization properties. This is not done for the Localization.SiteLocalizations.
The partially loaded Localization appears after a restart of the site. When all publications got a request, then all Localization objects are populated, including the ones in Localization.SiteLocalizations.
You can inspect the site Localization with this action and view: https://gist.github.com/jhorsman/679f6ab072c3896db41fcf893c3307b9
Edit: removed mention of /admin/refresh
The text was updated successfully, but these errors were encountered: