umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
Other
4.49k stars 2.69k forks source link

Error when adding standard Data Type 'List View - Members' #12714

Closed LordCererbus closed 2 years ago

LordCererbus commented 2 years ago

Which exact Umbraco version are you using? For example: 9.0.1 - don't just write v9

10.0.1

Bug summary

When adding a new property with the built-in Data Type 'List View - Members' I am getting the error:

An error occurred Ordering by username not supported.

Exception Details System.NotSupportedException, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e: Ordering by username not supported.

It's a bit odd. I don't think it's anything I've done as this should be out-of-the-box functionality. Let me know if it isn't.

Specifics

Received an error from the server

An error occurred Ordering by username not supported.

Exception Details System.NotSupportedException, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e: Ordering by username not supported.

Stacktrace

at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentRepositoryBase`3.ApplySystemOrdering(Sql`1& sql, Ordering ordering)
   at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.DocumentRepository.ApplySystemOrdering(Sql`1& sql, Ordering ordering)
   at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentRepositoryBase`3.ApplyOrdering(Sql`1& sql, Ordering ordering)
   at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentRepositoryBase`3.PreparePageSql(Sql`1 sql, Sql`1 filterSql, Ordering ordering)
   at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentRepositoryBase`3.GetPage[TDto](IQuery`1 query, Int64 pageIndex, Int32 pageSize, Int64& totalRecords, Func`2 mapDtos, Sql`1 filter, Ordering ordering)
   at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.DocumentRepository.GetPage(IQuery`1 query, Int64 pageIndex, Int32 pageSize, Int64& totalRecords, IQuery`1 filter, Ordering ordering)
   at Umbraco.Cms.Core.Services.ContentService.GetPagedChildren(Int32 id, Int64 pageIndex, Int32 pageSize, Int64& totalChildren, IQuery`1 filter, Ordering ordering)
   at Umbraco.Cms.Web.BackOffice.Controllers.ContentController.GetChildren(Int32 id, String includeProperties, Int32 pageNumber, Int32 pageSize, String orderBy, Direction orderDirection, Boolean orderBySystemField, String filter, String cultureName)
   at lambda_method1868(Closure , Object , Object[] )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

Steps to reproduce

Add a new property with the data type 'List View - Members'. Upon hitting save it comes up with an error.

Expected result / actual result

No error should happen. The field Username should be a sortable field for a member list.

github-actions[bot] commented 2 years ago

Hi there @LordCererbus!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:

nul800sebastiaan commented 2 years ago

Thanks for the report @LordCererbus. Unfortunately, I'm afraid I can't reproduce the problem in a clean 10.1.0 install. If you have any other steps to reproduce on a clean install we'd be happy to have another look but for now I'm going to have to close the issue as not reproducible.

https://user-images.githubusercontent.com/304656/180156399-60e68659-c99b-460d-a0c7-42f69d7e617f.mp4

LordCererbus commented 2 years ago

Hi @nul800sebastiaan, thanks for getting back to me. Sorry, I don't think I did a proper description of how to reproduce it. Here are the steps and a video of how to reproduce it.

  1. Using a clean build of v10.0.1, go to Settings and add a Document Type (I used Document with Template).
  2. Give the document template a name and save it.
  3. Now add a new property, give it a name and select the editor type 'List View - Members'
  4. Hit submit and as soon as you do it will error.

Please note that you must save the document type first before adding the member list view. If you add the member list view and then save the document type for the first time it seems to work. The problem I've got is that I need to add it to an already existing document type.

https://user-images.githubusercontent.com/52680822/180196561-03c8d269-05e4-4429-bc2b-382b83b07484.mp4

Thanks again.