+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Problem with KB article solution

Problem with KB article solution

3 posts, 0 answered
  1. Paul
    Paul avatar
    176 posts
    Registered:
    18 Nov 2008
    08 Jan 2012
    Link to this post

    Hi!

    I have applied one of the solution for localization for one of my site: http://www.sitefinity.com/devnet/kb/sitefinity-3-x/changing-the-default-site-language.aspx

    I applied this sql scripts:

    update sf_CmsPageContent set LangID='9' where LangID='127'

    update sf_CmsPageContent set LangID='127' where LangID='25'

     

    update sf_PageContentBase set LangID='9' where ID not in (select ID from sf_CmsTemplContent) and LangID='127'

    update sf_PageContentBase set LangID='127' where ID not in (select ID from sf_CmsTemplContent) and LangID='25'

    update sf_CmsCtrlLinks set LangID='9' where PageID not in (select ID from sf_CmsTemplContent) and LangID='127'

    update sf_CmsCtrlLinks set LangID='127' where PageID not in (select ID from sf_CmsTemplContent) and LangID='25'

    update sf_StagedPageContent set LangID='9' where LangID='127'

    update sf_StagedPageContent set LangID='127' where LangID='25'

    Tables sf_CmsContentVersion and sf_GCMetaData are not involved because they have correct LangId= 127. I use russian and english localization (english = 9 and russian is default so it's equal 127).

    But after I apply this in admin interface all my pages shows empty controls. If I open page it shows normally but if in admin interface it shows empty. Why does it happen? What I did wrong? I really need help with this bug.

  2. Paul
    Paul avatar
    176 posts
    Registered:
    18 Nov 2008
    09 Jan 2012
    Link to this post

    Hi!

    I understand what was the problem. In KB article you forgot to mention about table sf_StagedCtrlLinks. It also should be updated:

    update [sf_StagedCtrlLinks] set LangID='9' where PageID not in (select ID from sf_CmsTemplContent) and LangID='127'
    update [sf_StagedCtrlLinks] set LangID='127' where PageID not in (select ID from sf_CmsTemplContent) and LangID='25'

    After this update all works perfectly. Please add this in your KB article.

  3. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    11 Jan 2012
    Link to this post
    Hi,

    Thank you for contacting us. We will update the KB. In the mean time you can use this sample query for future reference:
    declare @oldDefaultLangId int
    declare @newDefaultLangId int
         
    set @oldDefaultLangId = 14
    set @newDefaultLangId = 9
         
    -- Convert pages
    Update sf_PageContentBase set LangID = @oldDefaultLangId where LangID = 127 and ItemType = 'CmsPageContent'
    Update sf_PageContentBase set LangID = 127 where LangID = @newDefaultLangId and ItemType = 'CmsPageContent'  
          
    Update sf_CmsPageContent set LangID = @oldDefaultLangId where LangID = 127
    Update sf_CmsPageContent set LangID = 127 where LangID = @newDefaultLangId
           
    Update sf_StagedPageContent set LangID = @oldDefaultLangId where LangID = 127 and ID in (select ID from sf_PageContentBase where ItemType = 'CmsPageContent')
    Update sf_StagedPageContent set LangID = 127 where LangID = @newDefaultLangId and ID in (select ID from sf_PageContentBase where ItemType = 'CmsPageContent')
           
    Update sf_CmsCtrlLinks set LangID = @oldDefaultLangId where LangID = 127 and PageID in (select ID from sf_PageContentBase where ItemType = 'CmsPageContent')
    Update sf_CmsCtrlLinks set LangID = 127 where LangID = @newDefaultLangId and PageID in (select ID from sf_PageContentBase where ItemType = 'CmsPageContent'
            
    Update sf_StagedCtrlLinks set LangID = @oldDefaultLangId where LangID = 127 and PageID in (select ID from sf_PageContentBase where ItemType = 'CmsPageContent')
    Update sf_StagedCtrlLinks set LangID = 127 where LangID = @newDefaultLangId and PageID in (select ID from sf_PageContentBase where ItemType = 'CmsPageContent')
           
         
    -- Convert generic content items.
    -- You should run this script if you have generic content modules with enabled localization in the web.config.
    -- In the IN clause specify the application names of the generic content providers with content with allowLocalization attribute set to true.
    -- For example: '/', '/News'
    Update sf_GCMetaData set LangID = @oldDefaultLangId where LangID = 127 and Application in ('/', '/News')
    Update sf_GCMetaData set LangID = 127 where LangID = @newDefaultLangId and Application in ('/', '/News')
            
    Update sf_CmsContentVersion set LangID = @oldDefaultLangId where LangID = 127 and Application in ('/', '/News')
    Update sf_CmsContentVersion set LangID = 127 where LangID = 9 and Application in ('/', '/News')
            
    Update sf_CmsTextContent set Culture = @oldDefaultLangId where Culture = 127 and Application in ('/', '/News')
    Update sf_CmsTextContent set Culture = 127 where Culture = @newDefaultLangId and Application in ('/', '/News')
           
    Update sf_VersionItem set CultureID = @oldDefaultLangId where CultureID = 127 and Application in ('/', '/News')
    Update sf_VersionItem set CultureID = 127 where CultureID = @newDefaultLangId and Application in ('/', '/News')
           
    Update sf_VrsTxtData set CultureID = @oldDefaultLangId where CultureID = 127 and Application in ('/', '/News')
    Update sf_VrsTxtData set CultureID = 127 where CultureID = @newDefaultLangId and Application in ('/', '/News')
          
    Update sf_VrsBinData set CultureID = @oldDefaultLangId where CultureID = 127 and Application in ('/', '/News')
    Update sf_VrsBinData set CultureID = 127 where CultureID = @newDefaultLangId and Application in ('/', '/News')


    All the best,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
3 posts, 0 answered