I get the following error when trying to update a document that I just copied...
[DataConnection.HandleError]: Query: Proc_CMS_Document_UpdateDocumentNamePath Caused exception: Procedure or function 'Proc_CMS_Document_UpdateDocumentNamePath' expects parameter '@GenerateAliases', which was not supplied.
The code I have is as follows.
TreeProvider treeProvider = new TreeProvider(user); TreeNode sourceNode = treeProvider.SelectSingleNode(SiteContext.CurrentSiteName, eventInfo.TemplateSourcePath, culture, false, null, false, true); TreeNode targetNode = treeProvider.SelectSingleNode(SiteContext.CurrentSiteName, eventInfo.TemplateTargetPath, culture, false, null, false, true); if (sourceNode != null && targetNode != null) { TreeNode conferenceDisplayName = DocumentHelper.CopyDocument(sourceNode, targetNode.NodeID, true, treeProvider, user.UserID); conferenceDisplayName.DocumentName = eventInfo.DisplayName; conferenceDisplayName.NodeAlias = eventInfo.CodeName; conferenceDisplayName.NodeName = eventInfo.DisplayName; conferenceDisplayName.SetDocumentNameSource(eventInfo.CodeName); bool enableDocumentAliases = treeProvider.EnableDocumentAliases; treeProvider.EnableDocumentAliases = false; DocumentHelper.UpdateDocument(conferenceDisplayName, treeProvider, "NodeName;NodeAlias;DocumentName"); treeProvider.EnableDocumentAliases = enableDocumentAliases; if (conferenceDisplayName.PublishedVersionExists) { VersionManager instance = VersionManager.GetInstance(treeProvider); instance.WorkflowManager.MoveToPublishedStep(conferenceDisplayName, "Conference auto-publish"); } }
Can anyone please help or let me know what I might be doing wrong? I'm using Kentico v8.0.14
Hello Alex!
Have you recently hotfixed / updated your Kentico instance? If so could you verify that the DLL files from the hotfix were brought over correctly that would be great. Seems like an out-of-date DLL file is referencing an old version of the stored procedure.
Ok for now this fixed it...
TreeNode conferenceDisplayName = DocumentHelper.CopyDocument(sourceNode, targetNode.NodeID, true, treeProvider, user.UserID, 0, false, eventInfo.DisplayName); //conferenceDisplayName.DocumentName = eventInfo.DisplayName;
Cancel that, adding the document name to the copydocument method has given that name to the document and it's children
Looks like the dlls were old. Not sure why that happened but it definitely fixed the issue. Thanks again.
Please, sign in to be able to submit a new answer.