Developer forum

Forum » CMS - Standard features » New language layer from master

New language layer from master

Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

This might be a stupid question but I can't see how I can create a new language layer from the master language AND get copies of pages and paragraphs.

The language layer that is created only has pages on the first level and no paragraphs. 

Regards / Aki

 


Replies

 
Dynamicweb Employee
Carsten Boll
Reply

Hi Ari,

I don't really understand if that happens, because I don't have any problems creating a language layer with all pages & paragraphs copied.. - see screenshot.

So that's the expected behavior - what version are you on? Have you got any weird language management settings checked?

LLtest.png
 
Aki Ruuskanen
Aki Ruuskanen
Reply

The solution is running 9.3.8. None och the checkboxes are checked in language management. 

Attaching screensshots of my language layer creation. 

language_layer.png
 
Aki Ruuskanen
Aki Ruuskanen
Reply

Carsten, did you make a copy from the master language or an exisiting language layer? 

/Aki

 
Dynamicweb Employee
Carsten Boll
Reply

From a master language - a language layer should always be a structural copy of a master. I can't click 'new language' when a language layer has been selected..

 
Aki Ruuskanen
Aki Ruuskanen
Reply

So, I guess I need to create a case of this. 

/Aki

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Seems like a bug in 9.3.8. 

Tested in our staging for same project wich runs 9.3.6 and there it works as expected. 

/Aki

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Found this in the logfiles:

 

2017-12-19 11:05:14.4358|ERROR|AreaService/Errors/Area_1|Error happened while executing operation! Area was not copied!
System.Exception: Failed to create the paragraph(3) copy. ---> System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Collections.ArrayList'.
   at Dynamicweb.Content.Items.Editors.ItemListEditor.PublishRelatedItems(Object value)
   at Dynamicweb.Content.Versioning.VersionControl.PublishItem(ItemEntry item, String itemTypeSystemName, ItemContext context)
   at Dynamicweb.Content.ParagraphService.HandleApprovalType(Paragraph paragraph)
   at Dynamicweb.Content.ParagraphService.SaveParagraph(Paragraph paragraph)
   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)
 
Dynamicweb Employee
Carsten Boll
Reply

I asked around, these types of errors re often related to one or more corrupt items in the db, often when using item relation lists.

I think creating a case is probably the way forward, but it's a place to look at least.

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Alright, thanks. 

I'll do some digging in the DB and see if I can find some rogue items. :)

/Aki

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Is there any smart way to debug this. 

Would be nice to know what Item is being published here:

"Dynamicweb.Content.Versioning.VersionControl.PublishItem(ItemEntry item, String itemTypeSystemName, ItemContext context)"

It a bit hard to try to find whats wrong just by looking in the DB. 

This solution does not have any integrations so there should not be anything crazy in the DB. 

Regards / Aki

 
Nicolai Pedersen
Reply

Hi Aki

The paragraph with ID 3 is the troublesome one - that is the number in exception message:

Failed to create the paragraph(3) copy
 
Aki Ruuskanen
Aki Ruuskanen
Reply

Thanks, I was just about ask about that. :)

/Aki

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Are you sure about that. Paragraph with ID 3 is a regular old school paragraph. Nothing to do with Items. 

Paragraph-3.JPG
 
Aki Ruuskanen
Aki Ruuskanen
Reply

I tried to make a new language layer again and got the same error but on another paragraph.

So I tried to just make a copy of that paragraph (Right click and select Copy Here).

Then I also got an error message. But the paragraph (and the item) got copied anyway. I dont't understand whats going on. 

I have a support case going on about this but I have not heard anything in while. 

 

[ApplicationException: Sql Exception occurred in ParagraphRepository.InsertParagraph]
   Dynamicweb.Content.Data.ParagraphRepository.InsertParagraph(Paragraph paragraph, Boolean restoringParagraph) +2110
   Dynamicweb.Content.Data.ParagraphRepository.Save(Paragraph paragraph) +33
   Dynamicweb.Content.ParagraphService.SaveParagraph(Paragraph paragraph) +354
   Dynamicweb.Content.ParagraphService.CopyTo(Int32 pageID, Int32 source, Boolean isExperiment) +822
   Dynamicweb.Management.Content.Dialogs.ContentDialogController.CopyParagraphsToPage(InsertParagraphsToPageDialogModel model, Boolean isCopyHere) +1005
   Dynamicweb.Management.Content.Dialogs.ContentDialogController.CopyParagraphsToPage(Int32 area, String CopyID, String pageId, Boolean isExperiment) +564
   lambda_method(Closure , ControllerBase , Object[] ) +242
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +157
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
   System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +22
   System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32
   System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +50
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +228
   System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34
   System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +26
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +100
   System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +36
   System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +12
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +22
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +26
   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +21
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9987157
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

 

 
Nicolai Pedersen
Reply

Hm. I think it might be related to "Select SCOPE_IDENTITY() As [SCOPE_IDENTITY]" something that cannot be executed for some reason.

Attached find a pirate version of Dynamicweb.dll 9.3.11 that will give you a more ellaborate SQL exception that should hopefully disclose more info so we can get closer...

BR Nicolai

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Ã…lrajt. I'll give it a go.

/Aki

 
Aki Ruuskanen
Aki Ruuskanen
Reply

I did indeed get a more descriptive error message:

[SqlException (0x80131904): The INSERT statement conflicted with the FOREIGN KEY constraint "Paragraph_FK00". The conflict occurred in database "easylaser.se", table "dbo.Page", column 'PageID'.
The statement has been terminated.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +2440274
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5765240
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +285
   System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4169
   System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +58
   System.Data.SqlClient.SqlDataReader.get_MetaData() +89
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption) +409
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) +2127
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) +911
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +64
   System.Data.SqlClient.SqlCommand.ExecuteScalar() +271
   Dynamicweb.Data.Database.ExecuteScalar(IDbCommand command) +372
   Dynamicweb.Data.Database.ExecuteScalar(CommandBuilder commandBuilder, IDbConnection connection, IDbTransaction transaction) +100
   Dynamicweb.Data.Database.ExecuteScalar(CommandBuilder commandBuilder, IDbConnection connection) +137
   Dynamicweb.Data.Database.ExecuteScalar(CommandBuilder commandBuilder) +7
   Dynamicweb.Content.Data.ParagraphRepository.InsertParagraph(Paragraph paragraph, Boolean restoringParagraph) +4953
   Dynamicweb.Content.Data.ParagraphRepository.Save(Paragraph paragraph) +99
   Dynamicweb.Content.ParagraphService.SaveParagraph(Paragraph paragraph) +810
   Dynamicweb.Content.ParagraphService.CopyTo(Int32 pageID, Int32 source, Boolean isExperiment) +1548
   Dynamicweb.Content.StructureChange.DuplicateParagraph(Int32 paragraphID, Int32 toPage, Boolean omcExperiment) +101
   Dynamicweb.Content.StructureChange.CopyParagraph(Int32 paragraphID, Int32 toPage, Boolean omcExperiment) +53
   Dynamicweb.Content.StructureChange.CopyParagraph(Int32 paragraphID, Int32 toPage) +50
   Dynamicweb.Management.Content.Dialogs.ContentDialogController.CopyParagraphsToPage(InsertParagraphsToPageDialogModel model, Boolean isCopyHere) +1019
   Dynamicweb.Management.Content.Dialogs.ContentDialogController.CopyParagraphsToPage(Int32 area, String CopyID, String pageId, Boolean isExperiment) +564
   lambda_method(Closure , ControllerBase , Object[] ) +242
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +157
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
   System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +22
   System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32
   System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +50
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +228
   System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34
   System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +26
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +100
   System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +36
   System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +12
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +22
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +26
   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +21
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9987157
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
 
Nicolai Pedersen
Reply

Even more mysterious...!

This happens when you do a copy here? Is it possible to get a link to this solution?

BR Nicolai

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Sorry about the delay. 

Here is the solution: https://easylaser.com/admin

/Aki

 

 

 

 

You must be logged in to post in the forum