Description
Expected behavior
When sorting fieldcollections with the arrow buttons in the backend, every child element of the collection should keep it's parent-child relation.
Actual behavior
When sorting fieldcollections with the arrow buttons in the backend, invisible elements inside of the collection are keeping their positions and therefore are getting mixed up and becoming children of a different fieldcollection.
Tested in Pimcore 10.2.4 + 10.2.8
Steps to reproduce
Create a new fieldcollection containing a panel, an input field (e.g. 'collectionTitle') and a second input field ("invisibleTitle"). Keep the second input visible for now.
Create a new class to add the fieldcollection to.
Create an object of this class and add at least two fieldcollections to it. Enter distinctive titles for the collections (e.g. "collection-1", "collection-2") and the "invisibleText" fields (e.g. "invisble-1", "invisible-2") . Save the created object.
If you change the position of the fieldcollection and save and reload the object, everything should be ok.
Now change the visibility of the second input field to "invisble" . Afterwards reload the created test object, change the position of the fieldcollections and save the object. Revert the visibility of the second input field to "visible", reload the test object and the
elements should be mixed up.
[edit]: The first version of this bug report only mentionend invisible block elements, but it seems that it's a general behaviour with any invisible element inside of fieldcollections.