November Happy Hour will be moved to Thursday December 5th.

Multisite project throws exception when having same simple address

Found in

EPiServer.CMS.Core 11.11.1

Fixed in

EPiServer.CMS.Core 11.11.2

(Or a related package)

Created

Feb 12, 2019

Updated

Apr 15, 2019

Area

CMS Core

State

Closed, Fixed and tested


Description

Steps to reproduce

1. Create a new Alloy project. Configure at least 3 sites on it (content can be cloned from original one). Let's call the site1.local, site2.local, and site3.local.
2. On site1.local, edit a page and set simple address to alloy.
3. On site2.local, edit a page and set simple address to alloy.
3. On site3.local, edit a page and set simple address to alloy,

Expected:
On site3.local, editor can set a simple address to alloy.

Actual:
CMS displays Offline, can't save message and throws an exception shown below.

[ArgumentOutOfRangeException]: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.Collections.Generic.List`1.RemoveAt(Int32 index)
at EPiServer.Web.Internal.SimpleAddress.FilterMatchingSites(UrlBuilder url, IList`1& pageIds, IList`1& languages)
at EPiServer.Web.Internal.SimpleAddress.Resolve(UrlBuilder url, SimpleAddressResolveContext simpleAddressContext)
at EPiServer.Web.Internal.DefaultAggregatedSimpleAddressResolver.Resolve(UrlBuilder url, SimpleAddressResolveContext simpleAddressContext)
at EPiServer.Web.Internal.DefaultUrlSegmentLocator.FindCollidingSimpleAddressOnSite(ContentReference contentLink, ContentReference parentLink, String urlSegment, String language, SiteDefinition sitedef)
at EPiServer.Web.Internal.DefaultUrlSegmentLocator.FindCollidingSimpleAddress(ContentReference contentLink, ContentReference parentLink, String urlSegment, String language)
at EPiServer.Web.Internal.DefaultUrlSegmentLocator.FindCollidingReference(ContentReference contentLink, ContentReference parentLink, String urlSegment, String language)
at EPiServer.Validation.Internal.SimpleAddressValidator.ValidatePagesWithSameExternalUrl(PageData pageData, String segment, String displayName)
at EPiServer.Validation.Internal.SimpleAddressValidator.Validate(PageData page)
at EPiServer.Validation.Internal.ContextValidatorWrapper`2.Validate(Object instance)
at EPiServer.Validation.Internal.ValidationService.ValidateRecursively(Object instance, Object context, HashSet`1 visitedInstances)
at EPiServer.Cms.Shell.UI.Rest.ContentChangeManager.UpdateContentProperties(ContentReference contentReference, IDictionary`2 properties, SaveAction saveAction)
at EPiServer.Cms.Shell.UI.Rest.Internal.ContentDataStore.Patch(PatchContentDataModel entity)
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c_DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b_3f()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c_DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b_3f()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c_DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b_3f()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c_DisplayClass21.<>cDisplayClass2b.<BeginInvokeAction>b_1c()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c_DisplayClass21.<BeginInvokeAction>b_1e(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
at EPiServer.Shell.Services.Rest.RestControllerBase.EndExecute(IAsyncResult asyncResult)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)