Custom navigation pane causing content not found exception

Fixed in

EPiServer.CMS.UI 11.20.1

Created

Apr 26, 2019

Updated

May 28, 2019

Area

CMS UI

State

Closed, Fixed and tested


Description

Steps to reproduce

  1. Copy code from this blog: https://www.epinova.no/en/blog/custom-icontent-with-its-own-navigation-pane/
  2. Browse the site.

Expected
Get a new tab in the assets.

Actual
A 500 error from the server when accessing a URL similar to this one:

http://localhost/EPiServer/cms/Stores/contentstructure/?references=-1_-1&query=getchildren&allLanguages=true&typeIdentifiers=cms11.business.test.review&sort(+name)&dojo.preventCache=1556270728019

ContentNotFoundException: Content with id -1_-1 was not found
    EPiServer.Core.Internal.DefaultContentLoader.Get(ContentReference contentLink, LoaderOptions loaderOptions) +530
    EPiServer.Cms.Shell.UI.Rest.ContentQuery.GetChildrenQuery.GetChildren(ContentQueryParameters parameters, ContentReference parentId, LanguageSelector selector) +233
    EPiServer.Cms.Shell.UI.Rest.ContentQuery.GetChildrenQuery.GetContent(ContentQueryParameters parameters) +562
    EPiServer.Cms.Shell.UI.Rest.ContentQuery.ContentQueryBase.ExecuteQuery(IQueryParameters parameters) +127
    EPiServer.Cms.Shell.UI.Rest.Internal.ContentStore.Get(ContentReference id, String query, ContentReference referenceId, ContentReference[] references, String[] typeIdentifiers, Nullable`1 allLanguages, IEnumerable`1 sortColumns, ItemRange range) +835
    lambda_method(Closure , ControllerBase , Object[] ) +486
    System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +229
    System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +35
    System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +39
    System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +77
    System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +42
    System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +72
    System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +387
    System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +387
    System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +387
    System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +42
    System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +38
    System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +188
    System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
    EPiServer.Shell.Services.Rest.RestControllerBase.EndExecute(IAsyncResult asyncResult) +122
    EPiServer.Shell.Services.Rest.RestHttpHandler.EndProcessRequest(IAsyncResult result) +108
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +602
    System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +128