Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom nested ordering no longer working. #7495

Open
slegay opened this issue Sep 11, 2024 · 0 comments
Open

Custom nested ordering no longer working. #7495

slegay opened this issue Sep 11, 2024 · 0 comments

Comments

@slegay
Copy link

slegay commented Sep 11, 2024

The document schema has a 'content' property, which is an array of objects, each having a 'term' and 'locale' properties.
We want to order those in the studio by the first content objects' term property. This used to work fine by declaring this ordering:

    orderings: [
      {
        title: 'English Term',
        name: 'termEnAsc',
        by: [
          {field: 'content[0].term', direction: 'asc'}
        ]
      },
    ],

However this no longer works, we get the following error in Studio:

Error: The current ordering config targeted the nonexistent field "content[0]" on schema type "glossaryTerm". It should be one of slug, content, childTermsRefs, synonyms, relatedTerms

We tried the preview selector syntax content.0.term, but that won't work either. Error: unexpected token "0.", expected expression

It seems impossible to select a property of a nested object within an array for ordering. But that used to work just fine. I would expect the sort order field selector to work the same way as the preview title selector, content.0.term, which works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant