Dnn.Platform
Dnn.Platform copied to clipboard
Make Cookie Consent Url localizable
Description of problem
On a multi lingual portal it is not possible to enter different Cookie Consent Urls for each language (e.g. https://en.wikipedia.org/wiki/HTTP_cookie for English, https://de.wikipedia.org/wiki/HTTP-Cookie for German, https://fr.wikipedia.org/wiki/Cookie_(informatique) for French etc.).
Description of solution
This setting should be dependant from the language.
Hmmm... Currently, this setting saves to the PortalSettings
table. I guess this would mean moving it to PortalLocalization
table as a new column since there isn't a localized table for portal settings.
In the specific example of Wikipedia, doesn't it detect and redirect based on browser locale?
@hismightiness PortalSettings support localization (since I added to in DNN 7)
Oh, I missed the CultureCode
column. I guess that means this is already a localized setting, right?
yes
Now I'm confused. 🤔😀
sorry, I meant PortalSettings table supports localization, but for CookieConsent URL, it needs to be wired to the UI.
But that URL is saved to the PortalSettings
table. I guess I'm missing something. :)
when saving a site setting in PortalSettings table, you may save it localized or "neutral". In this case, it needs to be change from "neutral" to "localized", allowing diferent URLs per laguage.
Ah... I didn't check the specific line of code that saves the URL.
Well, from a quick look at it every time you change it for any language, it saves the new (same) value for all languages:
Editing the values in the database appears to work though, so I guess the reading part is fine but we have something wrong in the writing (or maybe modifying part) of the code. it probably modifies all the existing ones instead of just the existing ones that match the currently selected language in the PersonaBar...
@valadas
this behavior is by design, if update is executed without providing a locale - with a locale provided, only value for this language will be updated.
@hismightiness:
In the specific example of Wikipedia, doesn't it detect and redirect based on browser locale?
No.
@sleupold, @valadas, @hismightiness:
I tried to add the records in the database (and restarted the AppPool):
This works - not really... :-(
To reproduce: Goto https://www.kaisermaximilianpreis.at.
Click on the link ("Mehr erfahren") - you come to the German Wikipedia Page. Close this page.
Click on "ENG" (top right), then click "Learn more". Again, you come to the German Wikipedia page. Close this page.
Refresh the page. Click "Learn more" again. You come to the English Wikipedia page. Close this page.
Click on "FRA". Click "Apprendre encore plus" - guess what opens. It is the English page again. Close it.
Refresh the page. Click "Apprendre encore plus" again, the French Wikipedia Page opens.
And so on...
???
@valadas this behavior is by design, if update is executed without providing a locale - with a locale provided, only value for this language will be updated.
It's not by design, when updating for one language it updates all languages to that value. Something is wrong somewhere. I tdoes read each language value properly but when saving it updates them all to the same value. This is wrong.
FYI - In general, making an update directly to the database for something like this may not be a true representation of the issue and how to reproduce it so someone can potentially fix it (or even that is does/doesn't work). I know everyone here so far knows that, so this comment is mostly for anyone else watching. :)
FYI - In general, making an update directly to the database for something like this may not be a true representation of the issue and how to reproduce it so someone can potentially fix it (or even that is does/doesn't work). I know everyone here so far knows that, so this comment is mostly for anyone else watching. :)
Correct, I was mainly pointing out that after testing this, the logic is fine but the saving is wrong, it updates all languages with the same value no mater which language you are attempting to edit. It is a workaround at least to adjust those existing entries until someone picks up on this issue.
sorry, I misread your statement. the logic should be:
- when updating without providing a CultureCode > update all values (or delete all language specific values and update/create just a neutral one
- when updating providing a CultureCode > update value for this language or create a record, if not exists.
Correct
We have detected this issue has not had any activity during the last 90 days. That could mean this issue is no longer relevant and/or nobody has found the necessary time to address the issue. We are trying to keep the list of open issues limited to those issues that are relevant to the majority and to close the ones that have become 'stale' (inactive). If no further activity is detected within the next 14 days, the issue will be closed automatically. If new comments are are posted and/or a solution (pull request) is submitted for review that references this issue, the issue will not be closed. Closed issues can be reopened at any time in the future. Please remember those participating in this open source project are volunteers trying to help others and creating a better DNN Platform for all. Thank you for your continued involvement and contributions!
AFAIK still an issue. Anyone willing to contribute a PR?
We have detected this issue has not had any activity during the last 90 days. That could mean this issue is no longer relevant and/or nobody has found the necessary time to address the issue. We are trying to keep the list of open issues limited to those issues that are relevant to the majority and to close the ones that have become 'stale' (inactive). If no further activity is detected within the next 14 days, the issue will be closed automatically. If new comments are are posted and/or a solution (pull request) is submitted for review that references this issue, the issue will not be closed. Closed issues can be reopened at any time in the future. Please remember those participating in this open source project are volunteers trying to help others and creating a better DNN Platform for all. Thank you for your continued involvement and contributions!
Still relevant.
We have detected this issue has not had any activity during the last 90 days. That could mean this issue is no longer relevant and/or nobody has found the necessary time to address the issue. We are trying to keep the list of open issues limited to those issues that are relevant to the majority and to close the ones that have become 'stale' (inactive). If no further activity is detected within the next 14 days, the issue will be closed automatically. If new comments are are posted and/or a solution (pull request) is submitted for review that references this issue, the issue will not be closed. Closed issues can be reopened at any time in the future. Please remember those participating in this open source project are volunteers trying to help others and creating a better DNN Platform for all. Thank you for your continued involvement and contributions!
Still relevant.
I triaged this, the fix should be pretty similar to https://github.com/dnnsoftware/Dnn.Platform/pull/4851/commits/636f7310355865c5d6715d04562c6d00b15595a3
Basically, we need to read and write using an API that we can provide with the culture code from the request and not let DNN find it from the alias. The alias might not be the language selected for which we want to set the setting.