I just upgraded an old website I had in umbraco 3.06 to the latest version (4.0.2.1). After some problems here and there I was able to complete the upgrade without any major issues, now... It seems (at least locally) that the dictionary it is not working. I have the following structure:
Content en es ... zh
Each folder (en, es, etc) contains a language specific version of the website. I assigned different host names and assigned a language for each one. This is actually working on the old version (online) but no more on the local version. The dictionary macro always returns an empty string.
I though that could be a problem with the upgrade, so I created a new dictionary entry, an empty page with an empty template and drop the dictionary control on it. Same result: nothing gets displayed.
It is the dictionary working on localhost? I don't want to upload the website only to test (I want to make sure everything is in place before replacing the old -working- site).
I've experienced the same issues when using a single domain and using root folders in 4.0.x. I ended up reviewing the source and what happens is that it searches for www.mywebsite.com as the host, everything else is ignored and when it finds that url assigned to a node it returns that node. So in your case it will always return localhost/en. If it can't find the url some it will take the url and try to find the assigned language recursive.
So what I ended up doing was assigning a bogus url "nl" for the dutch website and "en" for the engish site. that worked for me. Let me know if it helped you also. I've also set the umbracoHideTopLevelNodeFromPath setting to false. I'm not using extensionless url's so maybe you might need to do some additional configuration.
umbracoHideTopLevelNodeFromPath is set to true on my end, but that changes nothing. Also, I'm using the standard urls with extension (.aspx). You are correct, I'm using 3.0.6 on the live site (and there it is working perfectly).
The main issue here is that umbraco does not return any dictionary entry. My problem it is not that umbraco always returns the english dictionary entry, but that it does not returns anything. No matter how I setup the thing, the dictionary always returns an empty string.
Ok, now I really need this solved. I moved the staged (local) site to a test (live) server. The test server had 3.0.6 working fine. After I upgraded it, the dictionary stop working. Same as local. So, it is not a server configuration. This must be a problem in 4.0.2.1 or something related to the upgrade. Just to test, I setup another test site with the old version. 3.0.6 works fine, 4.0.2.1 does not. Same configuration, same website.
Found the problem! Previous versions of Umbraco allowed you to select a language... not a locale. In Umbraco 3.0.6, you can select (for example) English as a "language". In version 4, English is not an option. You must select a locale (a locale has, well, local information, such as number formatting, currency, etc). Since I had the old website setup with languages and not with locales (so, English, Spanish...) the upgraded website did not works.
I deleted all the languages, created them again (again, now they are Locales, not Languages), re-created the dictionary entries and everything started to work fine again.
I think that the default behavior of the upgrade process should be changed. Since the current option is "new website will not work -as expected- if you have used languages on the old website", Umbraco should convert the non-locale version of the language to a localized version... Pick one that best fits and use it (I'm not here to debate if I used English umbraco should convert that to en-us or en-uk... but in any case, at least the upgraded website will continue to work).
Ugh... another bug arises... the website WAS working with the above fix but... since I deleted the "English" language, it seems that now umbraco has some kind of bug trying to find the old language on the cache (or something like that). Now nothing works (nor the website, nor the backend).
Umbraco throws an exception: Value cannot be null. Parameter name: value
Ok, so, as a follow up from my previous post: If you have a language assigned to a domain and you delete the language, umbraco crash. To fix the issue, I opened the table umbracoDomains and changed the column domainDefaultLanguage with the ids of existing languages on the table umbracoLanguage. That fixed everything.
Dictionary not working on localhost
Hi,
I just upgraded an old website I had in umbraco 3.06 to the latest version (4.0.2.1). After some problems here and there I was able to complete the upgrade without any major issues, now... It seems (at least locally) that the dictionary it is not working. I have the following structure:
Content
en
es
...
zh
Each folder (en, es, etc) contains a language specific version of the website. I assigned different host names and assigned a language for each one. This is actually working on the old version (online) but no more on the local version. The dictionary macro always returns an empty string.
I though that could be a problem with the upgrade, so I created a new dictionary entry, an empty page with an empty template and drop the dictionary control on it. Same result: nothing gets displayed.
It is the dictionary working on localhost? I don't want to upload the website only to test (I want to make sure everything is in place before replacing the old -working- site).
Thanks in advance,
Hi,
Have you specified the host headers in IIS? Have you updated your hosts file to include the host names?
Let us know what you find!
Cheers,
/Dirk
I have updated the hosts file and by default my IIS return the correct host headers.
I found (by enabling trace) that there is some kind of error while umbraco tries to load the dictionary entry:
Ideas?
How have you got it setup in the current live site it is working on?
eg are the hostnames setup as: domain = www.mywebsite.com language=English(UK)
Are they setup the same on your localhost?
On the live site, each language folder has assigned 2 urls: www.mywebsite.com/en and mywebsite.com/en
On my machine, I setup the folders using the same scheme but replacing www.mywebsite.com by localhost (so, localhost/en, localhost/es, etc).
Youre live site is still running 3.0.6 right?
I've experienced the same issues when using a single domain and using root folders in 4.0.x. I ended up reviewing the source and what happens is that it searches for www.mywebsite.com as the host, everything else is ignored and when it finds that url assigned to a node it returns that node. So in your case it will always return localhost/en. If it can't find the url some it will take the url and try to find the assigned language recursive.
So what I ended up doing was assigning a bogus url "nl" for the dutch website and "en" for the engish site. that worked for me. Let me know if it helped you also. I've also set the umbracoHideTopLevelNodeFromPath setting to false. I'm not using extensionless url's so maybe you might need to do some additional configuration.
Hope it helps you,
Richard
umbracoHideTopLevelNodeFromPath is set to true on my end, but that changes nothing. Also, I'm using the standard urls with extension (.aspx). You are correct, I'm using 3.0.6 on the live site (and there it is working perfectly).
The main issue here is that umbraco does not return any dictionary entry. My problem it is not that umbraco always returns the english dictionary entry, but that it does not returns anything. No matter how I setup the thing, the dictionary always returns an empty string.
Ok, now I really need this solved. I moved the staged (local) site to a test (live) server. The test server had 3.0.6 working fine. After I upgraded it, the dictionary stop working. Same as local. So, it is not a server configuration. This must be a problem in 4.0.2.1 or something related to the upgrade. Just to test, I setup another test site with the old version. 3.0.6 works fine, 4.0.2.1 does not. Same configuration, same website.
Found the problem! Previous versions of Umbraco allowed you to select a language... not a locale. In Umbraco 3.0.6, you can select (for example) English as a "language". In version 4, English is not an option. You must select a locale (a locale has, well, local information, such as number formatting, currency, etc). Since I had the old website setup with languages and not with locales (so, English, Spanish...) the upgraded website did not works.
I deleted all the languages, created them again (again, now they are Locales, not Languages), re-created the dictionary entries and everything started to work fine again.
I think that the default behavior of the upgrade process should be changed. Since the current option is "new website will not work -as expected- if you have used languages on the old website", Umbraco should convert the non-locale version of the language to a localized version... Pick one that best fits and use it (I'm not here to debate if I used English umbraco should convert that to en-us or en-uk... but in any case, at least the upgraded website will continue to work).
Hope this helps others!
Great feedback, really appreciate sharing this for others who might run into this. Big thumbs up!
/Dirk
Ugh... another bug arises... the website WAS working with the above fix but... since I deleted the "English" language, it seems that now umbraco has some kind of bug trying to find the old language on the cache (or something like that). Now nothing works (nor the website, nor the backend).
Umbraco throws an exception: Value cannot be null. Parameter name: value
Ok, so, as a follow up from my previous post: If you have a language assigned to a domain and you delete the language, umbraco crash. To fix the issue, I opened the table umbracoDomains and changed the column domainDefaultLanguage with the ids of existing languages on the table umbracoLanguage. That fixed everything.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.