[MGNLREST-169] By default, items should have order that they have in Magnolia Created: 29/Jan/18 Updated: 27/Mar/18 Resolved: 11/Mar/18 |
|
| Status: | Closed |
| Project: | Magnolia REST Framework |
| Component/s: | delivery |
| Affects Version/s: | None |
| Fix Version/s: | 2.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Christopher Zimmermann | Assignee: | Mikaël Geljić |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | 0d | ||
| Time Spent: | 0.5d | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Template: |
|
||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||||||
| Release notes required: |
Yes
|
||||||||||||
| Documentation update required: |
Yes
|
||||||||||||
| Date of First Response: | |||||||||||||
| Sprint: | Saigon 137 | ||||||||||||
| Story Points: | 3 | ||||||||||||
| Description |
|
Expected behaviour: If I don't specify a sort, that I expect the items to have the order that they have in Magnolia. |
| Comments |
| Comment by Christopher Zimmermann [ 29/Jan/18 ] |
|
Until this is fixed, is there a workaround to get the items in the magnolia-stored order? |
| Comment by Mikaël Geljić [ 19/Feb/18 ] |
|
czimmermann Yes, you get a sorted array of child-node names under the @nodes property. This is an inherent limitation of JSON btw iirc. May we close this issue then? |
| Comment by Christopher Zimmermann [ 19/Feb/18 ] |
|
In this case - im referring to the query usage, I should have mentioned that. For example: |
| Comment by Mikaël Geljić [ 28/Feb/18 ] |
|
As per our discussion yesterday morning: I can confirm there is a default alphabetical sort on node names (ORDER BY LOWER(NAME(t)) statement in the JCR-SQL2 query), even when the orderBy param is not used. And I agree with you that queries should be "unsorted" by default. This doesn't necessarily mean natural order. It depends:
As an alternative, one may run a simple "read" request to the parent node and get the naturally-ordered child-nodes like I suggested earlier. |
| Comment by Christopher Zimmermann [ 28/Feb/18 ] |
|
Thanks for research and detailed response! |
| Comment by Christopher Zimmermann [ 27/Mar/18 ] |
|
Depth only affects which "children" a specfic node result has. So, yes - each result has its immediate childrenincluded (the areas). For me, what makes these results confusing - is that with the provided URL, I would somehow expect to be getting the NODE endpoint result of the ROOT node. But instead we get the QUERY endpoint result - and so it returns all of the pages - not just the pages at the root. I dont think there is a way to use the NODE endpoint at the root. (Can you confirm that sang.ngo ?) I have created a ticket to address that: https://jira.magnolia-cms.com/browse/MGNLREST-173 |