Change order of service converter check (#16182)

This commit is contained in:
Elitsa Marinovska
2024-05-06 13:38:29 +02:00
committed by Nikolaj Geisle
parent 73646a88b1
commit e352be14ea

View File

@@ -90,17 +90,18 @@ internal abstract class ContentListViewServiceBase<TContent, TContentType, TCont
.Select(p => p.Alias)
.WhereNotNull();
// Service layer expects "owner" instead of "creator", so make sure to pass in the correct field
if (orderBy.InvariantEquals("creator"))
{
orderBy = "owner";
}
if (listViewPropertyAliases.Contains(orderBy) == false && orderBy.InvariantEquals("name") == false)
{
return Attempt.FailWithStatus<Ordering?, ContentCollectionOperationStatus>(ContentCollectionOperationStatus.OrderByNotPartOfCollectionConfiguration, null);
}
// Service layer expects "owner" instead of "creator", so make sure to pass in the correct field
if (orderBy.InvariantEquals("creator"))
{
orderBy = "owner";
}
var orderByCustomField = listViewProperties
.Any(p => p.Alias == orderBy && p.IsSystem is false);