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 220 forks source link

BUGFIX: Fix handling of unset/nulled DataStructure keys #5032

Closed bwaidelich closed 2 months ago

bwaidelich commented 2 months ago

Re-establishes the Neos < 8.0 behavior of removed/nulled data structure keys

Background:

With #3645 a lot of Fusion core logic was refactored. As an unwanted side-effect, Neos.Fusion:DataStructure prototypes (effectively all implementations of the AbstractArrayFusionObject) now behave differently when it comes to removed or nulled keys and

Neos.Fusion:DataStructure {
    someProperty >
}

led to an array with:

{"someProperty":[]}

in Neos 8.0+.

This fix reverts this side-effect, making the above return

[]

again.

Fixes: #3859 Related: #3577, #3646

bwaidelich commented 2 months ago

Thanks to @kitsunet for helping me with this one! I added some Behat tests with #5033 (for branch 8.3 since we didn't have support for Fusion based Behat tests before)

bwaidelich commented 2 months ago

I'm not 100% sure about the implementation but I can confirm, that this fixed our issues

bwaidelich commented 2 months ago

The PR should target 8.3 according to our roadmap.

~arf, you're right.. I took some extra steps to target 8.0.. I'll re-integrate the changes with #5033 and will close this one~

~Update: I just realized that the regression was merged on March 23rd to no longer maintained branches 8.0, 8.1 and 8.2 (and for some reason it even made it into 7.3.9 o.O). So IMO it's fine (or even inevitable) to fix this in these branches, too~

Update2: I'm officially blind and didn't realize that it was Marc *2022 o.O – I'll close this one in favor of #5033 (against branch 8.3)