U4-7716 - Content type editor - YSOD when adding a property with the same alias as it's parent

Created by Shannon Deminick 13 Jan 2016, 16:02:30 Updated by Shannon Deminick 25 Jan 2016, 15:08:17

Is duplicated by: U4-7363

Relates to: U4-7634

To reproduce:

  • Create a root content type: ct1
  • Add a property group: "test"
  • Add a property type: "title"
  • Save
  • Create a child content type of ct1 called "ct1-child"
  • Add a property group: "test2"
  • Add a property type: "title"
  • Save = YSOD

YSOD contents are:

An error occured


 
 Mapping types:
 ContentTypeSave -> IContentType
 Umbraco.Web.Models.ContentEditing.ContentTypeSave -> Umbraco.Core.Models.IContentType
 
 Destination path:
 IContentType
 
 Source value:
 Umbraco.Web.Models.ContentEditing.ContentTypeSave

EXCEPTION DETAILS:

AutoMapper.AutoMapperMappingException: 
 
 Mapping types:
 ContentTypeSave -> IContentType
 Umbraco.Web.Models.ContentEditing.ContentTypeSave -> Umbraco.Core.Models.IContentType
 
 Destination path:
 IContentType
 
 Source value:
 Umbraco.Web.Models.ContentEditing.ContentTypeSave
STACKTRACE:

at Umbraco.Web.Editors.ContentTypeControllerBase.PerformPostSave[TContentType,TContentTypeDisplay](ContentTypeSave contentTypeSave, Func`2 getContentType, Func`2 getContentTypeByAlias, Action`1 saveContentType, Boolean validateComposition, Action`1 beforeCreateNew) in X:\Projects\Umbraco\Umbraco_7.4\src\Umbraco.Web\Editors\ContentTypeControllerBase.cs:line 262
   at Umbraco.Web.Editors.ContentTypeController.PostSave(ContentTypeSave contentTypeSave) in X:\Projects\Umbraco\Umbraco_7.4\src\Umbraco.Web\Editors\ContentTypeController.cs:line 175
   at lambda_method(Closure , Object , Object[] )
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()

Comments

Shannon Deminick 21 Jan 2016, 10:41:12

PR: https://github.com/umbraco/Umbraco-CMS/pull/1043

This also fixes more validation issues dealing with composed doc types


Claus Jensen 25 Jan 2016, 08:47:46

This resolves the remaining issues I was referring to in http://issues.umbraco.org/issue/U4-7783 on validation.

I'm however having some issues trying to merge this in with the abstractions you made in the other PR.


Shannon Deminick 25 Jan 2016, 14:08:21

Ok, i'll merge it in


Priority: Task - Pri 1

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.4.0

Due in version: 7.4.0

Sprint: Sprint 7

Story Points:

Cycle: