Developer forum

Forum » CMS - Standard features » Making an english site

Making an english site

Stephen Anthony Jackson
Reply

So we did a copy of the norwegian site, and set the new one to english. It seems to be ok, but we get an error on the component selector 

selectedComponentId = selectedComponentId > 0 && pageService.GetPageOrLanguage(selectedComponentId, areaId) != null ? pageService.GetPageOrLanguage(selectedComponentId, areaId).ID : selectedComponentId;

This throws the error

 

2024-04-24 15:03:17.728: Error executing razor template (Items/Swift_ComponentSelector.cshtml) https://valvolineoil.staging.dynamicweb-cms.com/Admin/Content/ParagraphEdit.aspx?ID=17907&PageID=3289. System.ArgumentNullException: Value cannot be null. Parameter name: source
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
at Dynamicweb.Content.PageService.GetPageOrLanguage(Int32 pageId, Int32 areaId)
at CompiledRazorTemplates.Dynamic.RazorEngine_cb428c1cdaab44bc9df5edd60246a227.Execute() in D:\dynamicweb.net\Solutions\TwodayAvento\valvolineoil.staging.dynamicweb-cms.com\files\Templates\Items\Swift_ComponentSelector.cshtml:line 91

 

Anyone any idea why "source" is null when using the english language site? Something we havent set?


Replies

 
Stephen Anthony Jackson
Reply

Anyone?

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Stephen,

It could be related to the PageIDs stored in the component configuration. When you copy the site, the new pages get new IDs. This means that your English site is trying to access the components from the Norwegian site which are not available. You have to manually edit all your templates that are referencing components.

There could also be other places where the values stored are actually PageIds from the Norwegian site.

Adrian

 

You must be logged in to post in the forum