Coder Social home page Coder Social logo

Comments (11)

worthy7 avatar worthy7 commented on May 24, 2024

Here is a timeline showing where the sql to update the settings table is executed. The red line showing where the Logs.txt file shows a timestamp while executing "GetAll"
image

And this is the log file where I believe something is updating the setting for the user to 'null'
image

from aspnetboilerplate.

worthy7 avatar worthy7 commented on May 24, 2024

Related issue from the past #5399

from aspnetboilerplate.

worthy7 avatar worthy7 commented on May 24, 2024

I also think that this code should be checking the language is actually an allowed language from the list of AbpLanguages. If not, it can just assign any language to the user which may not be a supported language and instead should revert to the default.

Or, this code for setting the language, should just not exist at all.

from aspnetboilerplate.

worthy7 avatar worthy7 commented on May 24, 2024

I can recreate this bug now in a solid test case.

  1. For any user, switch to the default app language (so the AppSettings table will have no entry for their language).
  2. Go into incognito mode, sign in with that user.

Due to the above mentioned, it will create a 'null' entry in the AppSettings table.

from aspnetboilerplate.

worthy7 avatar worthy7 commented on May 24, 2024

Hi @ismcagdas

Regarding this: https://aspnetboilerplate.com/Pages/Documents/Localization#asp-net-core

AbpUserRequestCultureProvider (ABP's provider): If the user is known via IAbpSession and has explicitly selected a language before (and saved to ISettingManager), then use the user's preferred language. If the user is known but has not selected any language and the .AspNetCore.Culture cookie or header has a value, set the user's language setting with that information and use this value as the current language. If the user is unknown, this provider does nothing.

How does the system know if the user explicitly selected the application default language?

from aspnetboilerplate.

ismcagdas avatar ismcagdas commented on May 24, 2024

saved to ISettingManager

It must be saved to AbpSettings table.

from aspnetboilerplate.

worthy7 avatar worthy7 commented on May 24, 2024

How is that possible though? The system does not save it to the table if it is the same as the default app language.

from aspnetboilerplate.

ismcagdas avatar ismcagdas commented on May 24, 2024

When you get a setting value using setting manager, the default value is returned if there is no specific setting saved for that user.

from aspnetboilerplate.

worthy7 avatar worthy7 commented on May 24, 2024

Right, but if you try to set the language setting of a user to that of the app default, it does not go into the AbpSettings table.

from aspnetboilerplate.

ismcagdas avatar ismcagdas commented on May 24, 2024

Yes, in that case the setting will be retrieved from setting definition in code behind, not from database. By the way, I couldn't understand what is your point here.

from aspnetboilerplate.

worthy7 avatar worthy7 commented on May 24, 2024

So, if the setting is not stored, how does AbpUserRequestCultureProvider know that it should NOT change the users language?

If the user is known but has not selected any language

It is not a reliable way to know if the user has selected a language. If the app default language is en-US then it cannot know if the user has selected no language or selected en-US

from aspnetboilerplate.

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.