U4-8447 - Cleanup MediaService (along ContentService)

Created by Stephan 12 May 2016, 09:02:06 Updated by Shannon Deminick 01 Jun 2016, 10:57:24

See U4-4748, do the same to media service.

Comments

Stephan 23 May 2016, 12:19:10

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

Review: just make sure that content and members still work but beware, I probably have broken XML for both, as this is an interim state while preparing for the new cache integration.


Stephan 27 May 2016, 11:09:34

Note to reviewer: can you please NOT squash-merge that one? U4-8497 comes on top of it and I'd like to avoid having to rebase everything. Thanks.


Shannon Deminick 30 May 2016, 12:13:08

Not sure what's changed in this code but a unit test is failing:

AutoMapper.AutoMapperConfigurationException : 
Unmapped members were found. Review the types and members below.
Add a custom mapping expression, ignore, add a custom resolver, or modify the source/destination type
=========================================================================================
IMemberGroup -> MemberGroupDisplay (Destination member list)
Umbraco.Core.Models.IMemberGroup -> Umbraco.Web.Models.ContentEditing.MemberGroupDisplay (Destination member list)

Unmapped properties:
Notifications
Icon
Trashed
ParentId
Alias

   at Umbraco.Tests.Models.Mapping.AutoMapperTests.Assert_Valid_Mappings() in X:\Projects\Umbraco\Umbraco_8.0\src\Umbraco.Tests\Models\Mapping\AutoMapperTests.cs:line 42

So not sure if an AutoMapper mapping has been added in this PR or if this bug is left over from something else.


Shannon Deminick 30 May 2016, 12:16:22

Creating a member fails in the back office

An error occured

Object reference not set to an instance of an object.

EXCEPTION DETAILS

System.NullReferenceException: Object reference not set to an instance of an object.
STACKTRACE

at Umbraco.Core.Services.MemberService.GetMemberType(String memberTypeAlias) in X:\Projects\Umbraco\Umbraco_8.0\src\Umbraco.Core\Services\MemberService.cs:line 1359
   at Umbraco.Core.Services.MemberService.Umbraco.Core.Services.IMembershipMemberService<Umbraco.Core.Models.IMember>.CreateWithIdentity(String username, String email, String passwordValue, String memberTypeAlias) in X:\Projects\Umbraco\Umbraco_8.0\src\Umbraco.Core\Services\MemberService.cs:line 252
   at Umbraco.Web.Security.Providers.UmbracoMembershipProvider`2.PerformCreateUser(String memberTypeAlias, String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) in X:\Projects\Umbraco\Umbraco_8.0\src\Umbraco.Web\Security\Providers\UmbracoMembershipProvider.cs:line 165
   at Umbraco.Core.Security.UmbracoMembershipProviderBase.CreateUser(String memberTypeAlias, String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) in X:\Projects\Umbraco\Umbraco_8.0\src\Umbraco.Core\Security\UmbracoMembershipProviderBase.cs:line 59
   at Umbraco.Web.Editors.MemberController.CreateWithMembershipProvider(MemberSave contentItem, MembershipCreateStatus& status) in X:\Projects\Umbraco\Umbraco_8.0\src\Umbraco.Web\Editors\MemberController.cs:line 611
   at Umbraco.Web.Editors.MemberController.PostSave(MemberSave contentItem) in X:\Projects\Umbraco\Umbraco_8.0\src\Umbraco.Web\Editors\MemberController.cs:line 317
   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.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.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()


Stephan 30 May 2016, 12:28:47

@Shandem the failing unit test is a leftover from some stuff you've done with member groups. Think you can have a look?

As for the member thing... looking into it.


Shannon Deminick 30 May 2016, 12:32:49

Cool no worries i can have a look at that one


Stephan 30 May 2016, 16:33:02

Have pushed fixes to the PR that deal with the members creation. Also fixed a few issues with xml serialization. That's going to change anyways with the cache refactoring. Hope it's OK now.


Shannon Deminick 01 Jun 2016, 10:50:41

Confirmed - all content/members work and all unit tests pass, will merge in (but not squash)


Priority: Normal

Type: Task

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version: 8.0.0

Sprint: Sprint 16

Story Points:

Cycle: