diff --git a/src/Umbraco.Core/Cache/RuntimeCacheProviderBase.cs b/src/Umbraco.Core/Cache/RuntimeCacheProviderBase.cs index 9dddb4c576..d88a3922bb 100644 --- a/src/Umbraco.Core/Cache/RuntimeCacheProviderBase.cs +++ b/src/Umbraco.Core/Cache/RuntimeCacheProviderBase.cs @@ -8,7 +8,7 @@ namespace Umbraco.Core.Cache /// An abstract class for implementing a runtime cache provider /// /// - /// THIS MUST REMAIN INTERNAL UNTIL WE STREAMLINE HOW ALL CACHE IS HANDLED, WE NEED TO SUPPORT HTTP RUNTIME CACHE, IN MEMORY CACHE, ETC... + /// THIS MUST REMAIN INTERNAL UNTIL WE STREAMLINE HOW ALL CACHE IS HANDLED, WE NEED TO SUPPORT HTTP RUNTIME CACHE, IN MEMORY CACHE, REQUEST CACHE, ETC... /// internal abstract class RuntimeCacheProviderBase : CacheProviderBase { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/moveOrCopy.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/moveOrCopy.aspx.cs index ba48e944fa..2e804cee13 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/moveOrCopy.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/moveOrCopy.aspx.cs @@ -217,23 +217,35 @@ namespace umbraco.dialogs var nodeAllowed = false; IContentBase currContent; - IContentBase parentContent; - IContentTypeBase parentContentType; + IContentBase parentContent = null; + IContentTypeBase parentContentType = null; if (CurrentApp == "content") { currContent = Services.ContentService.GetById(Request.GetItemAs("id")); - parentContent = Services.ContentService.GetById(Request.GetItemAs("copyTo")); - parentContentType = Services.ContentTypeService.GetContentType(parentContent.ContentTypeId); + if (Request.GetItemAs("copyTo") != -1) + { + parentContent = Services.ContentService.GetById(Request.GetItemAs("copyTo")); + if (parentContent != null) + { + parentContentType = Services.ContentTypeService.GetContentType(parentContent.ContentTypeId); + } + } } else { currContent = Services.MediaService.GetById(Request.GetItemAs("id")); - parentContent = Services.MediaService.GetById(Request.GetItemAs("copyTo")); - parentContentType = Services.ContentTypeService.GetMediaType(parentContent.ContentTypeId); + if (Request.GetItemAs("copyTo") != -1) + { + parentContent = Services.MediaService.GetById(Request.GetItemAs("copyTo")); + if (parentContent != null) + { + parentContentType = Services.ContentTypeService.GetMediaType(parentContent.ContentTypeId); + } + } } // Check on contenttypes - if (Request.GetItemAs("copyTo") == -1) + if (parentContentType == null) { nodeAllowed = true; } @@ -268,7 +280,7 @@ namespace umbraco.dialogs pane_form_notice.Visible = false; panel_buttons.Visible = false; - var newNodeCaption = Request.GetItemAs("copyTo") == -1 + var newNodeCaption = parentContent == null ? ui.Text(CurrentApp) : parentContent.Name; @@ -290,19 +302,19 @@ namespace umbraco.dialogs feedback.type = uicontrols.Feedback.feedbacktype.success; // refresh tree - ClientTools.MoveNode(currContent.Id.ToString(), parentContent.Path); + ClientTools.MoveNode(currContent.Id.ToString(), currContent.Path); } else { //NOTE: We ONLY support Copy on content not media for some reason. - Services.ContentService.Copy((IContent)currContent, Request.GetItemAs("copyTo"), RelateDocuments.Checked, getUser().Id); + var newContent = Services.ContentService.Copy((IContent)currContent, Request.GetItemAs("copyTo"), RelateDocuments.Checked, getUser().Id); feedback.Text = ui.Text("moveOrCopy", "copyDone", nodes, getUser()) + "

" + ui.Text("closeThisWindow") + ""; feedback.type = uicontrols.Feedback.feedbacktype.success; // refresh tree - ClientTools.CopyNode(currContent.Id.ToString(), parentContent.Path); + ClientTools.CopyNode(currContent.Id.ToString(), newContent.Path); } } }