neos / neos-development-collection

The unified repository containing the Neos core packages, used for Neos development.
https://www.neos.io/
GNU General Public License v3.0
260 stars 218 forks source link

FEATURE: References on creation and Copy #5148

Open kitsunet opened 2 weeks ago

kitsunet commented 2 weeks ago

This reworks references so that multiple reference properties can be set via a single command and also references can be attached to CreateNodeAggregateWithNode which is also used for copying nodes.

The serialization format is adapted to allow multiple reference properties, which also affects all behat tests with references.

A behat test to show reference copies work was added.

kitsunet commented 2 weeks ago

Do not merge yet, probably want to refactor some of the code in the DTOs. I think we should make the "collection of references for one reference property" an explicit DTO, as the code like this feels a bit too messy for my taste...

kitsunet commented 2 weeks ago

On the upside the somewhat weird and unfinished reference snapshots can be removed with this.

kitsunet commented 2 weeks ago

And forgot to adapt legacy migration tests (which rely on specific event payloads, see below, before I adjust those we should decide which way to go with b/c)...

kitsunet commented 2 weeks ago

oh and I should mention that at the moment this is not forgiving to the existing events. We could do this in the respective fromArray constructors of the DTOs and just "upcast" from the old structure on the fly without much problem, or add a migration for the events.

kitsunet commented 2 weeks ago
Screenshot 2024-06-18 at 08 47 52

I think this would be much nicer code wise (obviously duplicated for Serialized...), bit annoying to use 3 objects for this, but I think it will make the code much better to reason with and empty is then really just the new "middle DTO" with createEmpty()