[MGNLUI-1458] AbstractJcrNodeAdapter adds nodes to JCR in random order Created: 28/May/13  Updated: 10/Mar/21  Resolved: 10/Mar/21

Status: Closed
Project: Magnolia UI
Component/s: framework
Affects Version/s: 5.0
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Tobias Mattsson Assignee: Unassigned
Resolution: Obsolete Votes: 0
Labels: adapters
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
depends upon MGNLUI-1453 Create a MultiLinkField Closed
relation
is related to MGNLUI-1459 Can not add more than one JcrNewNodeA... Closed
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
Date of First Response:

 Description   

The problem is that it keeps nodes internally in a HashMap keyed by name. It then iterates this map and adds new node in the order decided by the HashMaps internal hashing function.



 Comments   
Comment by Eric Hechinger [ 05/Jun/13 ]

Wrong order in multiselect is related to this issue.

Comment by Eric Hechinger [ 05/Jun/13 ]

this commit is a partial resolution.
https://git.magnolia-cms.com/gitweb/?p=magnolia_ui.git;a=commit;h=d16311f0320e3d40a671ca22f6bbe84f4ead3666
Solved part:
node has no children, we create
-child2
-child1
-child3
This order will be Jcr child node order.
I a same way, if node has already child2 and we create child3/child1 the Jcr order will be
-child2
-child3
-child1

Unfortunately, it does not solve the root issue:
node has as children:

  • child1
  • child2
    In the related item we decide to change the order (child2, child1), this will not be reflected.
    I a equivalent way, if node has only child1, and we create a JcrnewNodeAdapter child2 and would like to have the following order (child2, child1), this will not be reflected.
Generated at Mon Feb 12 08:46:47 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.