Git Product home page Git Product logo

Comments (5)

rpannekoek avatar rpannekoek commented on July 19, 2024

I would expect the Localization.EnsureInitialized method to throw an exception when the Localization cannot be initialized (because the underlying Publication is not published); I don't like silently ignoring error conditions (it tends to lead to unclear errors/exception later in the process).
However, it seems to me this "issue" is related to your work-around for another issue: #45
Do you think this issue is still relevant if that other issue would be fixed?

from dxa-web-application-dotnet.

jhorsman avatar jhorsman commented on July 19, 2024

This issue is releated to #45 in the sense that #45 has a try-catch block as a workaround for this exception.

Comment #45 (comment) is descibing a workaournd to load all localizations. It calls Localization.EnsureInitialized() which might throw this exception.

This issue (#48) will still be relevant when #45 is resolved because there can be other logic which calls Localization.EnsureInitialized().

from dxa-web-application-dotnet.

jhorsman avatar jhorsman commented on July 19, 2024

Maybe the real issue is that the Localization object exists in the first place. I agree that something should happen when `Localization.EnsureInitialized()' cannot load the Localization, but it is is unexpected when a publication's settings page is not published?

If DXA would load all Localization.SiteLocalizations and remove the SiteLocalizations which cannot be loaded then it would not be an issue, and Localization.EnsureInitialized() can thow the error indeed. Added #45 (comment) to descirbe this in a bit more detail.

from dxa-web-application-dotnet.

rpannekoek avatar rpannekoek commented on July 19, 2024

I agree with the idea to suppress Localization for Publications which are not published from Localization.SiteLocalizations and still letting Localization.EnsureInitialized throw an exception in case it cannot be initialized (this is really be an exceptional, unrecoverable error condition). Would you agree with closing this issue and keeping #48 open, then?

from dxa-web-application-dotnet.

jhorsman avatar jhorsman commented on July 19, 2024

yes, agree 👍

from dxa-web-application-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.