Try our conversational search powered by Generative AI!

Copy and Paste broken - results in 500 in dojo

Vote:
 

When a user copy and pastes any object be it Page/Block/Media in the content tree, we get the following error in the console log:

POST http://cbbbdev.com/EPiServer/cms/Stores/contentstructure/305599 500 (Internal Server Error)xhr @ dojo.js:15500dojo.xhr @ dojo.js:14628declare._xhr @ XhrWrapper.js:206(anonymous function) @ XhrWrapper.js:104(anonymous function) @ dojo.js:3135when @ dojo.js:9053declare.xhr @ XhrWrapper.js:98declare._send @ JsonRest.js:298declare.copy @ JsonRest.js:240declare.pasteItem @ ContentTreeStoreModel.js:388dispatcher.around.advice @ dojo.js:6158(anonymous function) @ dojo.js:6061(anonymous function) @ ContentTreeModelConfirmation.js:166when @ dojo.js:9053(anonymous function) @ ContentTreeModelConfirmation.js:164signal.advice @ dojo.js:6071target.(anonymous function).dispatcher @ dojo.js:6139(anonymous function) @ ContentTreeStoreModel.js:347(anonymous function) @ dojo.js:3135signalListener @ dojo.js:8324then.promise.then @ dojo.js:8545when @ dojo.js:9064(anonymous function) @ ContentTreeStoreModel.js:346array.map @ dojo.js:3646declare.copy @ ContentTreeStoreModel.js:344declare._execute @ PasteContent.js:61declare.execute @ _Command.js:92declare.onClick @ _CommandModelBindingMixin.js:70declare.onItemClick @ _MenuBase.js:258(anonymous function) @ _MenuBase.js:65(anonymous function) @ dojo.js:5642(anonymous function) @ a11yclick.js:84
dojo.js:14453 ErrorCtor {message: "Unable to load /EPiServer/cms/Stores/contentstructure/305599 status: 500", response: Object, status: 500, responseText: "
↵
↵    
↵         in production environments.-->", xhr: XMLHttpRequest}message: "Unable to load /EPiServer/cms/Stores/contentstructure/305599 status: 500"response: ObjectresponseText: "
↵
↵    
↵        Object reference not set to an instance of an object.
↵
↵    
↵
↵            

Server Error in '/' Application.

↵ ↵

Object reference not set to an instance of an object.

↵ ↵ ↵ ↵ Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. ↵ ↵

↵ ↵ Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

↵ ↵ Source Error:

↵ ↵ ↵ ↵ ↵ ↵
↵
↵Line 44:         void DataFactoryCreatingPage(object sender, PageEventArgs e)
↵Line 45:         {
↵Line 46:             var parentLink = e.Page.ParentLink;
↵Line 47:             var page = e.Page;
↵Line 48:             parentLink = GetNewParent(parentLink, page);
↵ ↵
↵ ↵
↵ ↵ Source File: c:\Sites\PhoenixCMS\PhoenixCore\OpenFramework\Initialization\ArchiveStructureInitializationModule.cs    Line: 46 ↵

↵ ↵ Stack Trace:

↵ ↵ ↵ ↵ ↵ ↵
↵
↵[NullReferenceException: Object reference not set to an instance of an object.]
↵   PhoenixCore.OpenFramework.Initialization.ArchiveStructureInitializationModule.DataFactoryCreatingPage(Object sender, PageEventArgs e) in c:\Sites\PhoenixCMS\PhoenixCore\OpenFramework\Initialization\ArchiveStructureInitializationModule.cs:46
↵   EPiServer.PageEventHandler.Invoke(Object sender, PageEventArgs e) +0
↵   EPiServer.Core.DefaultContentEvents.RaiseCorrespondingPageEvent(String key, ContentEventArgs eventArgs) +175
↵   EPiServer.Core.DefaultContentEvents.RaiseCancellableContentEvent(String key, String defaultReason, ContentEventArgs eventArgs) +162
↵   EPiServer.Core.DefaultContentRepository.Copy(ContentReference contentLink, ContentReference destinationLink, AccessLevel requiredSourceAccess, AccessLevel requiredDestinationAccess, Boolean publishOnDestination) +250
↵   EPiServer.IContentRepositoryExtension.Copy(IContentRepository contentRepository, ContentReference source, ContentReference destination) +166
↵   EPiServer.Cms.Shell.UI.Rest.ContentChangeManager.Copy(IContent source, IContent destination, Boolean createAsLocalAsset) +133
↵   EPiServer.Cms.Shell.UI.Rest.ContentStructureStore.CopyContent(IContent source, IContent destination, Boolean createAsLocalAsset, ActionResponse`1 response) +145
↵   EPiServer.Cms.Shell.UI.Rest.ContentStructureStore.ExecuteAction(ContentReference sourceContentLink, ContentReference destinationContentLink, Boolean createAsLocalAsset, Func`5 action, ActionResponse`1& result) +605
↵   EPiServer.Cms.Shell.UI.Rest.ContentStructureStore.Copy(ContentReference id, ContentReference targetId, Nullable`1 createAsLocalAsset, Nullable`1 sortIndex) +625
↵   lambda_method(Closure , ControllerBase , Object[] ) +283
↵   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +234
↵   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39
↵   System.Web.Mvc.Async.<>c__DisplayClass39.b__33() +120
↵   System.Web.Mvc.Async.<>c__DisplayClass4f.b__49() +452
↵   System.Web.Mvc.Async.<>c__DisplayClass4f.b__49() +452
↵   System.Web.Mvc.Async.<>c__DisplayClass37.b__36(IAsyncResult asyncResult) +15
↵   System.Web.Mvc.Async.<>c__DisplayClass2a.b__20() +33
↵   System.Web.Mvc.Async.<>c__DisplayClass25.b__22(IAsyncResult asyncResult) +236
↵   EPiServer.Shell.Services.Rest.RestControllerBase.EndExecute(IAsyncResult asyncResult) +97
↵   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +1271
↵   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +2427
↵   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +299
↵
↵ ↵
↵ ↵
↵ ↵
↵ ↵ Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34209 ↵ ↵
↵ ↵ ↵ ↵"stack: (...)get stack: () { [native code] }set stack: () { [native code] }status: 500xhr: XMLHttpRequest__proto__: ErrorCtor_deferError @ dojo.js:14453(anonymous function) @ dojo.js:14413notify @ dojo.js:8122complete @ dojo.js:8103reject.errback @ dojo.js:8165notify @ dojo.js:8137complete @ dojo.js:8103reject.errback @ dojo.js:8165(anonymous function) @ dojo.js:14648signalListener @ dojo.js:8324signalWaiting @ dojo.js:8315reject.reject @ dojo.js:8506signalDeferred @ dojo.js:8371signalListener @ dojo.js:8345signalWaiting @ dojo.js:8315reject.reject @ dojo.js:8506signalDeferred @ dojo.js:8371signalListener @ dojo.js:8345signalWaiting @ dojo.js:8315reject.reject @ dojo.js:8506signalDeferred @ dojo.js:8371signalListener @ dojo.js:8342signalWaiting @ dojo.js:8315reject.reject @ dojo.js:8506signalDeferred @ dojo.js:8371signalListener @ dojo.js:8345signalWaiting @ dojo.js:8315reject.reject @ dojo.js:8506handleResponse @ dojo.js:15348onLoad @ dojo.js:15370 dojo.js:8826 SyntaxError: Unexpected token < at Object.dojo.fromJson (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:9097:23) at http://cbbbdev.com/EPiServer/CMS/8.2.1.0/ClientResources/epi-cms/widget/ContentTreeModelConfirmation.js:127:64 at signalListener (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8324:21) at signalWaiting (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8315:4) at reject.reject (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8506:5) at signalDeferred (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8371:15) at signalListener (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8345:4) at signalWaiting (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8315:4) at reject.reject (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8506:5) at signalListener (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8324:21) "SyntaxError: Unexpected token < at Object.dojo.fromJson (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:9097:23) at http://cbbbdev.com/EPiServer/CMS/8.2.1.0/ClientResources/epi-cms/widget/ContentTreeModelConfirmation.js:127:64 at signalListener (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8324:21) at signalWaiting (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8315:4) at reject.reject (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8506:5) at signalDeferred (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8371:15) at signalListener (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8345:4) at signalWaiting (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8315:4) at reject.reject (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8506:5) at signalListener (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8324:21) ---------------------------------------- rejected at signalDeferred (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8371:15) at signalListener (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8342:5) at signalWaiting (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8315:4) at reject.reject (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8506:5) at signalDeferred (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8371:15) at signalListener (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8345:4) at signalWaiting (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8315:4) at reject.reject (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8506:5) at signalListener (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8324:21) at signalWaiting (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8315:4) ---------------------------------------- Error at Promise.then.promise.then (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8539:24) at when (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:9064:26) at onResponse (http://cbbbdev.com/EPiServer/CMS/8.2.1.0/ClientResources/epi-cms/widget/ContentTreeModelConfirmation.js:115:13) at null. (http://cbbbdev.com/EPiServer/CMS/8.2.1.0/ClientResources/epi-cms/widget/ContentTreeModelConfirmation.js:172:30) at target.(anonymous function).dispatcher [as pasteItem] (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:6149:52) at null. (http://cbbbdev.com/EPiServer/CMS/8.2.1.0/ClientResources/epi-cms/widget/ContentTreeStoreModel.js:347:33) at http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:3135:55 at signalListener (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8324:21) at Promise.then.promise.then (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8545:5) at when (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:9064:26)"logError @ dojo.js:8826(anonymous function) @ dojo.js:8873array.filter @ dojo.js:3694logRejected @ dojo.js:8868 dojo.js:15500 POST http://cbbbdev.com/EPiServer/cms/Stores/contentstructure/214873 500 (Internal Server Error)xhr @ dojo.js:15500dojo.xhr @ dojo.js:14628declare._xhr @ XhrWrapper.js:206(anonymous function) @ XhrWrapper.js:104(anonymous function) @ dojo.js:3135when @ dojo.js:9053declare.xhr @ XhrWrapper.js:98declare._send @ JsonRest.js:298declare.copy @ JsonRest.js:240declare.pasteItem @ ContentTreeStoreModel.js:388dispatcher.around.advice @ dojo.js:6158(anonymous function) @ dojo.js:6061(anonymous function) @ ContextualContentForestStoreModel.js:521signalListener @ dojo.js:8324then.promise.then @ dojo.js:8545when @ dojo.js:9064(anonymous function) @ ContextualContentForestStoreModel.js:512signal.advice @ dojo.js:6071(anonymous function) @ dojo.js:6061(anonymous function) @ ContentTreeModelConfirmation.js:166when @ dojo.js:9053(anonymous function) @ ContentTreeModelConfirmation.js:164signal.advice @ dojo.js:6071target.(anonymous function).dispatcher @ dojo.js:6139(anonymous function) @ ContentTreeStoreModel.js:347(anonymous function) @ dojo.js:3135signalListener @ dojo.js:8324then.promise.then @ dojo.js:8545when @ dojo.js:9064(anonymous function) @ ContentTreeStoreModel.js:346array.map @ dojo.js:3646declare.copy @ ContentTreeStoreModel.js:344declare._execute @ PasteContent.js:61declare.execute @ _Command.js:92declare.onClick @ _CommandModelBindingMixin.js:70declare.onItemClick @ _MenuBase.js:258(anonymous function) @ _MenuBase.js:65(anonymous function) @ dojo.js:5642(anonymous function) @ a11yclick.js:84 dojo.js:14453 ErrorCtor {message: "Unable to load /EPiServer/cms/Stores/contentstructure/214873 status: 500", response: Object, status: 500, responseText: " ↵ ↵ ↵ in production environments.-->", xhr: XMLHttpRequest}_deferError @ dojo.js:14453(anonymous function) @ dojo.js:14413notify @ dojo.js:8122complete @ dojo.js:8103reject.errback @ dojo.js:8165notify @ dojo.js:8137complete @ dojo.js:8103reject.errback @ dojo.js:8165(anonymous function) @ dojo.js:14648signalListener @ dojo.js:8324signalWaiting @ dojo.js:8315reject.reject @ dojo.js:8506signalDeferred @ dojo.js:8371signalListener @ dojo.js:8345signalWaiting @ dojo.js:8315reject.reject @ dojo.js:8506signalDeferred @ dojo.js:8371signalListener @ dojo.js:8345signalWaiting @ dojo.js:8315reject.reject @ dojo.js:8506signalDeferred @ dojo.js:8371signalListener @ dojo.js:8342signalWaiting @ dojo.js:8315reject.reject @ dojo.js:8506signalDeferred @ dojo.js:8371signalListener @ dojo.js:8345signalWaiting @ dojo.js:8315reject.reject @ dojo.js:8506handleResponse @ dojo.js:15348onLoad @ dojo.js:15370 dojo.js:8826 SyntaxError: Unexpected token < at Object.dojo.fromJson (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:9097:23) at http://cbbbdev.com/EPiServer/CMS/8.2.1.0/ClientResources/epi-cms/widget/ContentTreeModelConfirmation.js:127:64 at signalListener (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8324:21) at signalWaiting (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8315:4) at reject.reject (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8506:5) at signalDeferred (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8371:15) at http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8357:4 at signalListener (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8324:21) at signalWaiting (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8315:4) at reject.reject (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8506:5) "SyntaxError: Unexpected token < at Object.dojo.fromJson (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:9097:23) at http://cbbbdev.com/EPiServer/CMS/8.2.1.0/ClientResources/epi-cms/widget/ContentTreeModelConfirmation.js:127:64 at signalListener (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8324:21) at signalWaiting (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8315:4) at reject.reject (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8506:5) at signalDeferred (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8371:15) at http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8357:4 at signalListener (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8324:21) at signalWaiting (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8315:4) at reject.reject (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8506:5) ---------------------------------------- rejected at signalDeferred (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8371:15) at signalListener (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8342:5) at signalWaiting (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8315:4) at reject.reject (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8506:5) at signalDeferred (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8371:15) at http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8357:4 at signalListener (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8324:21) at signalWaiting (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8315:4) at reject.reject (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8506:5) at signalDeferred (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8371:15) ---------------------------------------- Error at Promise.then.promise.then (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8539:24) at when (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:9064:26) at onResponse (http://cbbbdev.com/EPiServer/CMS/8.2.1.0/ClientResources/epi-cms/widget/ContentTreeModelConfirmation.js:115:13) at null. (http://cbbbdev.com/EPiServer/CMS/8.2.1.0/ClientResources/epi-cms/widget/ContentTreeModelConfirmation.js:172:30) at target.(anonymous function).dispatcher [as pasteItem] (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:6149:52) at null. (http://cbbbdev.com/EPiServer/CMS/8.2.1.0/ClientResources/epi-cms/widget/ContentTreeStoreModel.js:347:33) at http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:3135:55 at signalListener (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8324:21) at Promise.then.promise.then (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:8545:5) at when (http://cbbbdev.com/EPiServer/Shell/8.2.1.0/ClientResources/dojo/dojo.js:9064:26)"logError @ dojo.js:8826(anonymous function) @ dojo.js:8873array.filter @ dojo.js:3694logRejected @ dojo.js:8868
#122713
Jun 10, 2015 20:13
Vote:
 

Hi,

From what I can see you have a NullReferenceException in your own code in ArchiveStructureInitializationModule. My guess is that e.Page is null. So add a null check for that.

#122714
Edited, Jun 11, 2015 5:19
Vote:
 

This is Johan what I call "head-time-compile" :)

#122717
Edited, Jun 11, 2015 8:32
Vote:
 

Oh my goodness, I can't beileve I missed that in the error message itself...  Thank you so much, always good to have an extra pair of eyes look at this stuff!

#122752
Jun 11, 2015 15:43
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.