SenseNet / sensenet

Open Source Content Services Platform written in .NET
https://sensenet.com
GNU General Public License v2.0
173 stars 112 forks source link

[BUG]Ordering by localized fieldvalue does not work as expected #603

Open herflis opened 5 years ago

herflis commented 5 years ago

I try to sort groups by their DisplayNames but it does not work for the default workspace groups like 'Members' and 'Visitors' because the DisplayNames are localized and their actual value is $ContentTemplate,something. This issue could be checked on the old admin surface (content explorer) too.

Steps to reproduce:

  1. Login at https://dmsservice.demo.sensenet.com with admin
  2. Open the explorer https://dmsservice.demo.sensenet.com/Explore.htm
  3. Navigate to /Root/Sites/Default_Site/workspaces/Sales/arizonasalesworkspace/Groups
  4. Try to sort the items by their DisplayName

Steps to reproduce with OData:

  1. Login at https://dmsservice.demo.sensenet.com with admin
  2. Navigate the following url https://dmsservice.demo.sensenet.com/odata.svc/Root/Sites/Default_Site/workspaces/Sales/arizonasalesworkspace/Groups?$select=DisplayName&$orderby=DisplayName&metadata=no

Current response:

{
  "d": {
    "__count": 3,
    "results": [
      {
        "DisplayName": "Members"
      },
      {
        "DisplayName": "Visitors"
      },
      {
        "DisplayName": "Owners"
      }
    ]
  }
}

Expected response:

{
  "d": {
    "__count": 3,
    "results": [
      {
        "DisplayName": "Members"
      },
      {
        "DisplayName": "Owners"
      },
      {
        "DisplayName": "Visitors"
      }
    ]
  }
}
tusmester commented 5 years ago

I agree but added the discussion flag bacause it involves rethinking how these fields are indexed.

https://www.youtube.com/watch?v=rF2m9YPHvKo