Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • CheloXL 8 posts 30 karma points
    Aug 19, 2009 @ 17:11
    CheloXL
    0

    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,

  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Aug 19, 2009 @ 20:03
    Dirk De Grave
    0

    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

  • CheloXL 8 posts 30 karma points
    Aug 19, 2009 @ 20:16
    CheloXL
    0

    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:

    library Error returning dictionary item 'langCodes' 
    Value cannot be null.
    Parameter name: value
    at System.Web.Caching.CacheEntry..ctor(String key, Object value, CacheDependency dependency, CacheItemRemovedCallback onRemovedHandler, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, Boolean isPublic)
    at System.Web.Caching.CacheInternal.DoInsert(Boolean isPublic, String key, Object value, CacheDependency dependencies, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback, Boolean replace)
    at System.Web.Caching.Cache.Add(String key, Object value, CacheDependency dependencies, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback)
    at umbraco.cms.businesslogic.cache.Cache.GetCacheItem[TT](String cacheKey, Object syncLock, CacheItemPriority priority, CacheItemRemovedCallback refreshAction, CacheDependency cacheDependency, TimeSpan timeout, GetCacheItemDelegate`1 getCacheItem)
    at umbraco.cms.businesslogic.language.Language.GetByCultureCode(String CultureCode)
    at umbraco.library.GetDictionaryItem(String Key)

    Ideas?

  • Tom Maton 387 posts 659 karma points
    Aug 19, 2009 @ 20:53
    Tom Maton
    0

    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?

     

  • CheloXL 8 posts 30 karma points
    Aug 19, 2009 @ 21:23
    CheloXL
    0

    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).

  • Richard Soeteman 3875 posts 12037 karma points MVP
    Aug 20, 2009 @ 08:56
    Richard Soeteman
    0

    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

     

     

  • CheloXL 8 posts 30 karma points
    Aug 20, 2009 @ 15:32
    CheloXL
    0

    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.

  • CheloXL 8 posts 30 karma points
    Aug 20, 2009 @ 20:54
    CheloXL
    0

    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.

  • CheloXL 8 posts 30 karma points
    Aug 20, 2009 @ 21:27
    CheloXL
    1

    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!

  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Aug 20, 2009 @ 21:32
    Dirk De Grave
    0

    Great feedback, really appreciate sharing this for others who might run into this. Big thumbs up!

     

    /Dirk

  • CheloXL 8 posts 30 karma points
    Aug 20, 2009 @ 21:36
    CheloXL
    0

    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

    [ArgumentNullException: Value cannot be null.
    Parameter name: value]
       System.Web.Caching.CacheEntry..ctor(String key, Object value, CacheDependency dependency, CacheItemRemovedCallback onRemovedHandler, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, Boolean isPublic) +3599655
       System.Web.Caching.CacheInternal.DoInsert(Boolean isPublic, String key, Object value, CacheDependency dependencies, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback, Boolean replace) +88
       System.Web.Caching.Cache.Add(String key, Object value, CacheDependency dependencies, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback) +81
       umbraco.cms.businesslogic.cache.Cache.GetCacheItem(String cacheKey, Object syncLock, CacheItemPriority priority, CacheItemRemovedCallback refreshAction, CacheDependency cacheDependency, TimeSpan timeout, GetCacheItemDelegate`1 getCacheItem) +213
       umbraco.cms.businesslogic.cache.Cache.GetCacheItem(String cacheKey, Object syncLock, CacheItemPriority priority, CacheItemRemovedCallback refreshAction, TimeSpan timeout, GetCacheItemDelegate`1 getCacheItem) +84
       umbraco.cms.businesslogic.cache.Cache.GetCacheItem(String cacheKey, Object syncLock, CacheItemRemovedCallback refreshAction, TimeSpan timeout, GetCacheItemDelegate`1 getCacheItem) +80
       umbraco.cms.businesslogic.cache.Cache.GetCacheItem(String cacheKey, Object syncLock, TimeSpan timeout, GetCacheItemDelegate`1 getCacheItem) +76
       umbraco.cms.businesslogic.language.Language..ctor(Int32 id) +239
       umbraco.cms.businesslogic.web.Domain.initDomain(Int32 id) +178
       umbraco.cms.businesslogic.web.Domain.<GetDomains>b__0() +235
       umbraco.cms.businesslogic.cache.Cache.GetCacheItem(String cacheKey, Object syncLock, CacheItemPriority priority, CacheItemRemovedCallback refreshAction, CacheDependency cacheDependency, TimeSpan timeout, GetCacheItemDelegate`1 getCacheItem) +109
       umbraco.cms.businesslogic.cache.Cache.GetCacheItem(String cacheKey, Object syncLock, CacheItemPriority priority, CacheItemRemovedCallback refreshAction, TimeSpan timeout, GetCacheItemDelegate`1 getCacheItem) +84
       umbraco.cms.businesslogic.cache.Cache.GetCacheItem(String cacheKey, Object syncLock, CacheItemRemovedCallback refreshAction, TimeSpan timeout, GetCacheItemDelegate`1 getCacheItem) +80
       umbraco.cms.businesslogic.cache.Cache.GetCacheItem(String cacheKey, Object syncLock, TimeSpan timeout, GetCacheItemDelegate`1 getCacheItem) +76
       umbraco.cms.businesslogic.web.Domain.GetDomains() +158
       umbraco.cms.businesslogic.web.Domain.GetDomainsById(Int32 nodeId) +37
       umbraco.cms.presentation.editContent.updateLinks() +446
       umbraco.cms.presentation.editContent.OnInit(EventArgs e) +3398
       System.Web.UI.Control.InitRecursive(Control namingContainer) +321
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +834
    
     I think I will have to start messing with the DB... ideas where to start? :(

  • CheloXL 8 posts 30 karma points
    Aug 20, 2009 @ 21:59
    CheloXL
    1

    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.

  • 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.

Please Sign in or register to post replies