neos / neos-ui

Neos CMS UI written in ReactJS with Immutable data structures.
GNU General Public License v3.0
265 stars 135 forks source link

Document tree behaves wrong when moving nodes (and other oddities) #2761

Open kdambekalns opened 4 years ago

kdambekalns commented 4 years ago

Description

When moving nodes in a setup that uses content dimensions, the tree becomes out of sync with the actual state after switching dimensions.

Steps to Reproduce

Have a Neos system with at least one content dimension with two values. I observed this with a language dimension using a fallback, but that might not be a requirement for the issue. Now set the stage:

  1. Create a document
  2. Create a sub-document
  3. Translate that sub-document to another language

Now, switch back to the first language and:

  1. Move the document to another position in the tree
  2. Switch to the other language
  3. Check the position of the moved document in the tree

Expected behavior

After moving the node, the tree shows the moved nodes in their new position (only), regardless of dimension and initially displayed document node when the move was done.

Actual behavior

The tree shows the moveed node(s) in their new and their old position after switching the dimension value. This could be observed in a client project and was reproducable.

I could also reproduce it in our own website (UI v 5.2.1.) Unfortunately I can no longer (fully) reproduce it tonight, while recording the behaviour. Anyway, some things are still not as they should be: https://vimeo.com/440815395

The bug seems (even more) fixed with the latest 5.2 branch code (reporting version 5.2.3.) But there are still oddities, see: https://vimeo.com/440806435

Affected Versions

Neos: 5.2

UI: 5.2

Maybe the bug exists in older versioons already, I did not test older versions, sorry.

kdambekalns commented 4 years ago

@franzkugelmann - Could you add anything I missed? Check the exact versions of Neos and the UI in your project?

Sebobo commented 4 years ago

There are several places in which the nodedata from the server gets not correctly merged into the cached data. I recently fixed 3 of those (1 in 4.0.x and up the other two in 5.x). It's possible there are more left... 😔

franzkugelmann commented 4 years ago

We use the latest release: Neos 5.2.2 UI version: 5.2.3 We have only the language-dimension with de and en. Some pages in the tree are only there in english, others only in german. The problem seems to occur only if the editor has a subpage of the moved page open in the editor. (Moves the part of the tree where she was working in before). Since Neos tries to keep the current page when switching dimension values, but the path is not correct anymore, that might cause the confusion.

Sebobo commented 3 months ago

@grebaldi do you think this could now be fixed by #3822 too ?

grebaldi commented 3 months ago

@Sebobo:

do you think this could now be fixed by https://github.com/neos/neos-ui/pull/3822 too ?

That would be a surprise :) No, #3822 doesn't contain specifics that would touch the issue described here.

It may still have been fixed through measures taken elsewhere in the meantime. To be sure, I will try to reproduce this issue and report back (or probably come up with a fix).