Skip to content
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

Read Language.Culture in ApplicationService.Initialize #1845

Closed
Urreman opened this issue Apr 4, 2022 · 4 comments
Closed

Read Language.Culture in ApplicationService.Initialize #1845

Urreman opened this issue Apr 4, 2022 · 4 comments

Comments

@Urreman
Copy link
Contributor

Urreman commented Apr 4, 2022

When site is saved, the culture is set from it's previous value (which is allways null since there is no input field for site culture).
Instead it should be stored from it's connected language culture.

Possible solution:
https://github.com/PiranhaCMS/piranha.core/blob/master/core/Piranha.Manager/Services/SiteService.cs
public async Task Save(SiteEditModel model){
...
var language = await _api.Languages.GetByIdAsync(model.LanguageId);
if (language != null) {
site.Culture = language.Culture;
}
...
}

@tidyui
Copy link
Member

tidyui commented Apr 4, 2022

Long time no see @Urreman!!! I think this is a backwards compatibility bug, like you say the property site.Culture is never used, it was used before the Language model was added. The current culture should be fetched from the selected Language of the current site.

We should however update the ApplicationService that can be accessed with @WebApp so that it automatically sets culture from the selected language.

@tidyui
Copy link
Member

tidyui commented Apr 4, 2022

So to clarify, there was a culture field on the site edit UI but it was removed. The problem is that the property is still there in the model.

@tidyui tidyui changed the title Save language culture to Site Read Language.Culture in ApplicationService.Initialize Apr 4, 2022
@tidyui
Copy link
Member

tidyui commented Apr 4, 2022

@tidyui tidyui added this to the Version 10.1 milestone Apr 4, 2022
@tidyui tidyui added this to To do in Version 10.1 via automation Apr 4, 2022
@Urreman
Copy link
Contributor Author

Urreman commented Apr 5, 2022 via email

@tidyui tidyui closed this as completed in 88133ab Apr 5, 2022
Version 10.1 automation moved this from To do to Done Apr 5, 2022
tidyui added a commit that referenced this issue Apr 5, 2022
@tidyui tidyui self-assigned this Apr 5, 2022
@tidyui tidyui moved this from Done to In progress in Version 10.1 Apr 13, 2022
@tidyui tidyui moved this from In progress to Done in Version 10.1 Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

2 participants