Upgraded Sites not applying Culture code when redirecting

Daniel Main asked on July 22, 2019 15:51

We are in the final stages of an upgrade from V9 to V12 (I know we should not be upgrading this many steps at once) and most of the sites seem to be working well, but this issues has me bugged.

We have a custom web bart that switches the culture which worked in V9 but only seems to be working halfway in V12.

The key code is here:

            CultureHelper.SetPreferredCulture(cultureCode);
            CultureHelper.SetPreferredUICultureCode(cultureCode);
            // Force
            Response.Redirect( CurrentDocument.NodeAliasPath, true);

On our sites we have 2 cultures en-US and es-ES. If I attempt to swap to the es-ES from en-US the redirect keeps it on en-US (worked in V9) but going the other way, forcing the es-Es in the url, manual reloading which loads the Spanish site, then selecting English causes it to properly redirect to the English version.

Any suggestions would be welcome.

I have attempted to add the culture code directly into the redirect, but that did not provide any change.

Recent Answers


Brenden Kehren answered on July 22, 2019 16:31

When you did the upgrade, did you upgrade to each major version then run the website after each major version upgrade? Secondly, have you tried resigning the macros?

0 votesVote for this answer Mark as a Correct answer

Daniel Main answered on July 22, 2019 16:45

Yes, the company that did a majority of the upgrade didthe major version stepping.

Had not though of resigning macros since the code did not seem to use macros and most everything else seems to work.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on July 22, 2019 16:49

Macros are used throughout the Kentico UI admin site as well as other places so it's a start, I'd suggest trying that. Also, are you on the latest hotfix or the vanilla version of 12.0? You should be on a hotfix, not the vanilla version of 12.0

0 votesVote for this answer Mark as a Correct answer

Daniel Main answered on July 22, 2019 17:59

We are on v12.0.25

0 votesVote for this answer Mark as a Correct answer

Daniel Main answered on July 22, 2019 18:43

Just finished Resigning the Macros and it did not help.

0 votesVote for this answer Mark as a Correct answer

Daniel Main answered on July 22, 2019 19:08

I did get a workaround set up: as per https://docs.kentico.com/k12sp/multilingual-websites/setting-up-multilingual-websites/configuring-urls-for-multilingual-websites

Applying the query string did the job, but I think the question now is why the original method worked in V9.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.