-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Bug: Paste of multiple content nodes results in wrong order #3040
Comments
@markusguenther Maybe we can provide a PR for this, at least for some parts of it. But first I would like to know if you, like I do, think the fix should go into the NEOS UI and not in the mentioned service I ask, because it might be possible to fix this in the service, but imho the service should not make a decision and rearrange the order to insert which might cause more confusion. What do you think? |
We actually found that the payload seems to have the right order. The Problem lies within the anchor (siblingDomAddress) beeing used to insert the nodes. The siblingDomAddress passed via each copyAfter event is always the same (as shown in your example above). If we would like to keep the current style of sending multiple copy events we would have to adjust the siblingDomAddress for the n+1 copy events which is not possible as we dont know the sibling which will be created in the future. To us the solution seems to lie in having a copyAfter event wich can hold multiple copied nodes instead of having multiple events. As far as i can think this should also fix the problem 3. Tested in Neos 8.1 |
Running into the same issue when moving nodes in batches. |
Workaround for editors: select nodes in bottom to top order when inserting after or top to bottom order when inserting before. |
…hildnodes Without this change the copied nodes get their „index“ copied too, which could position them in between existing nodes and creating a seemingly random result for the editor. Resolves: #3040
…hildnodes Without this change the copied nodes get their „index“ copied too, which could position them in between existing nodes and creating a seemingly random result for the editor. Resolves: #3040
Description
If you copy multiple content nodes from one document and paste them in another document the order of the copied content nodes can get somewhat mixed up.
The actual paste is done by
/neos/ui-services/change
, but I think the request payload provided has a wrong order. Thus I think it's an issue of the JS part of the neos ui - see below for request details.Steps to Reproduce
Expected behavior
The pasted order is preserved.
Actual behavior
The order depends on where you paste it in the target document:
before
some other content node - This worksafter
some content node - The order is reversedmain
content collection of the target document and just click the paste button - The order is mixed in between content elementsCaptured requests
I'm not quite sure what exactly is going on in case of the
Mixed order
, but for theCopyAfter
operation, the set of nodes to paste should be reversed in the request payload.If you look at the working request, that is the
CopyBefore
operation, the reason why the order is correct is, that the copied nodes are copied before thesiblingDomAddress
in the order given. Thus the same order appears.In case of the
CopyAfter
, let's assume we want to copy nodesn1
,n2
,n3
in that order after nodec
. After the first operation we have the orderc
,n1
. Looks good. Thenn2
is copied afterc
, thus the orderc
,n2
,n1
appears. The same withn3
and we get the final reversed orderc
,n3
,n2
,n1
.At least, that's what I think happens.
Working request
Reverse order
Mixed in between
Affected Versions
Neos: 7.2 - presumably earlier versions
UI:
The text was updated successfully, but these errors were encountered: