Developer forum

Forum » Ecommerce - Standard features » Error when trying to add a new language to a website

Error when trying to add a new language to a website

Ólafur Einar Þorbergsson
Reply

Hello.

I'm having difficulties adding a language to a website. I keep getting a nullreference error when DW tries to create the copy.

I first got this error on a paragraph that I had excluded and thought that it might be the problem, so I tried deleting that paragraph but then the same error just moved on to the next paragraph. I'll include the trace below.

It seems that either the Page or Area are null when get_IsMaster() is being called.

The paragraph in question in this log is a very basic paragraph built on the Paragraph item type. The restrictions on the item are set to "All" so that should not be the blocking factor.

The permissions on the paragraph are shown on the screenshot below

 

My user has full Administrative access.

Do you have any idea what could be causing this issue?

Regards,

Ólafur


Replies

 
Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply

Hi Ólafur

which version of Dw your using?

can you post Area data table here

Thanks

 
Ólafur Einar Þorbergsson
Reply

Hi Shiwanka.

I'm currently using version 9.7.1 but I'll update it to 9.8.10 and see if that fixes things. Meanwhile, you'll find the Area table attached :)

 

Regards,

Ólafur

 
Ólafur Einar Þorbergsson
Reply

I tried updating to 9.8.10

Still having the same problem.

Regards, 

Ólafur

 
Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply

yes, update and try

i dnt see immediate issue in area table 

 
Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply

same error, or different error?

 
Ólafur Einar Þorbergsson
Reply

Edit:

Exactly the same error, but on a different *Paragraph this time.

 
Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply

your try to copy area english into Other right?

can you select default language to area english and try

 
Ólafur Einar Þorbergsson
Reply

I'm copying from Icelandic to English.

Tried another language, without luck

 
Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply

is it a hosted site or local? if its possible give me a url

 
Ólafur Einar Þorbergsson
Reply

It's local, unfortunately. I've tried this on the web which is hosted on a closed network, same issue there.

 
Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply

are you sure, you have selected default language for english and it has value right?

 
Nicolai Pedersen
Reply

Hi Ólafur 

I have asked our support to contact you and see if they can find out what is wrong. It can be an item type that no longer exist.

We might ask for a copy of the solution for troubleshooting.

BR Nicolai

 
Ólafur Einar Þorbergsson
Reply

This specific area you're referencing to is disabled and not being used. 

What I'm trying to do is add an english version of the Olgerdin website, which has "is" as language.

 

And in the language table the language is there, with the Id = 1

 
Ólafur Einar Þorbergsson
Reply

Thanks Nicolai. 

At first I thought that it might be an item type that does not exist, but as stated above in the trace, it's referencing the basic item type "Paragraph" which definitely exists. Now after updating to newer version, the same error occured, but now on a different paragraph with a different item. 

 

Trace:

2020-11-03 11:48:36.505: Error happened while executing operation! Area was not copied!. System.Exception: Failed to create the paragraph(1353) copy. 
System.Exception: Failed to create copy of the paragraph(1353) item('Paragraph' with id '118'). 
System.NullReferenceException: Object reference not set to an instance of an object.
at Dynamicweb.Content.Paragraph.get_IsMaster()
at Dynamicweb.Content.ParagraphService.SaveParagraph(Paragraph paragraph)
at Dynamicweb.Content.Items.Queries.Repository.SynchronizePageStructure(Item currentItem, Boolean updateModificationDate, Item originalItem, ItemContext context)
at Dynamicweb.Content.Items.Queries.Repository.Update(IEnumerable`1 items, ItemContext context, Boolean synchronizePages)
at Dynamicweb.Content.Items.Queries.Repository.Update(ItemEntry item, ItemContext context)
at Dynamicweb.Content.Items.ItemEntry.Save(ItemContext context)
at Dynamicweb.Content.AreaService.CopyItem(Entity`1 source, String itemId, String itemType)
at Dynamicweb.Content.AreaService.CopyParagraphItem(Paragraph paragraph, Paragraph copiedParagraph, Dictionary`2 itemIndex)
--- End of inner exception stack trace ---
at Dynamicweb.Content.AreaService.CopyParagraphItem(Paragraph paragraph, Paragraph copiedParagraph, Dictionary`2 itemIndex)
at Dynamicweb.Content.AreaService.CopyParagraphs(CopyAreaInfo copyAreaInfo, Action`1 copyStatusFn, List`1 itemsToUpdateLinks, Dictionary`2 itemIndex, Dictionary`2 pageIndex, Dictionary`2 paragraphIndex, IEnumerable`1 paragraphs)
--- End of inner exception stack trace ---
at Dynamicweb.Content.AreaService.CopyParagraphs(CopyAreaInfo copyAreaInfo, Action`1 copyStatusFn, List`1 itemsToUpdateLinks, Dictionary`2 itemIndex, Dictionary`2 pageIndex, Dictionary`2 paragraphIndex, IEnumerable`1 paragraphs)
at Dynamicweb.Content.AreaService.CopyArea(CopyAreaInfo copyAreaInfo)

 

The trace above is my most recent try, and searching for the item in the DB shows that it's there

 

 

 

 

 

 
Martin Vang
Martin Vang
Reply

Hi Ólafur,

Just pitching in, to let you know that the error you're experiencing is probably related bad data in the following way:

1. Paragraph refers to a page that does not exist OR has null as parant id

2. Page refers to an area (website) that does not exist OR has null as parent id

I think the following sql query will give you a list of problematic paragraphs that you need to fix:

SELECT par.ParagraphId as ParagraphId, pa.PageId as PageId
FROM Paragraph as par 
FULL OUTER JOIN [Page] as pa on par.ParagraphPageId = pa.PageId
FULL OUTER JOIN Area as a on pa.PageAreaId = a.AreaId
WHERE PageId is null OR AreaId is null

Hope this helps you track down the issue, by giving you a list of PageIds and ParagraphIds that cause problems . Let me know how it goes.

BR

Martin

 

 
Ólafur Einar Þorbergsson
Reply

Hi Martin,

Thanks for the input.

This query returns empty, so I guess that the problem doesn't lie there :/

I've got an employee assigned to my case, that has been analyzing the issue. Hopefully he can help me solve this :)

 

Regards,

Ólafur

 

 

You must be logged in to post in the forum