U4-7885 - YComposition is neither IContentType nor IMediaType ysod when saving member type

Created by Mads Rasmussen 03 Feb 2016, 09:47:25 Updated by Shannon Deminick 03 Feb 2016, 11:05:28

An error occured

Composition is neither IContentType nor IMediaType?

EXCEPTION DETAILS

System.Exception: Composition is neither IContentType nor IMediaType?
[DEFAULTDIALOGS_STACKTRACE]

at Umbraco.Core.Services.ContentTypeService.ValidateLocked(IContentTypeComposition compositionContentType) in \\psf\Home\Documents\test\Umbraco-CMS\src\Umbraco.Core\Services\ContentTypeService.cs:line 673
   at Umbraco.Core.Services.ContentTypeService.ValidateComposition(IContentTypeComposition compo) in \\psf\Home\Documents\test\Umbraco-CMS\src\Umbraco.Core\Services\ContentTypeService.cs:line 644
   at Umbraco.Web.Editors.ContentTypeControllerBase.CreateCompositionValidationExceptionIfInvalid[TContentTypeSave,TPropertyType,TContentTypeDisplay](TContentTypeSave contentTypeSave, IContentTypeComposition composition) in \\psf\Home\Documents\test\Umbraco-CMS\src\Umbraco.Web\Editors\ContentTypeControllerBase.cs:line 319
   at Umbraco.Web.Editors.ContentTypeControllerBase.PerformPostSave[TContentType,TContentTypeDisplay,TContentTypeSave,TPropertyType](TContentTypeSave contentTypeSave, Func`2 getContentType, Action`1 saveContentType, Action`1 beforeCreateNew) in \\psf\Home\Documents\test\Umbraco-CMS\src\Umbraco.Web\Editors\ContentTypeControllerBase.cs:line 206
   at Umbraco.Web.Editors.MemberTypeController.PostSave(MemberTypeSave contentTypeSave) in \\psf\Home\Documents\test\Umbraco-CMS\src\Umbraco.Web\Editors\MemberTypeController.cs:line 134
   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

Stephan 03 Feb 2016, 10:21:28

MemberTypeController inherits from ContentTypeControllerBase which uses ContentTypeService to validate compositions, where ContentTypeService should ''really'' only deal with IContentType, not IMemberType. Will "do it right" in v8 I guess, so for the time being, fixing ContentTypeService...


Stephan 03 Feb 2016, 10:32:05

Since there are no compositions on members, all we need to do is assume that any member type is valid.


Stephan 03 Feb 2016, 10:34:08

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


Priority: Normal

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 8

Story Points:

Cycle: