array.append with merge with non array fails silently


Lucee fails silently, ACF still appends the value

Merge: This argument only applies when the value is an array.

If set to true appends array elements individually to the source array.

If false (default) the complete array is added as one element at the end, in the source array.

Lucee should either match the ACF behaviour or throw an exception


Brad Wood
July 14, 2020, 6:45 AM

The explanation for this is found here:
Lucee considers (among other things)

  • empty structs

  • structs with numeric keys

to be castable to an array.

So I disagree that it's strictly 'failing silently'. It's more that Lucee has a more loose sense of what an array is compared to Adobe CF, which I'm sure is important for the BIF to be able to work with native Java collections.

For compatibility, an additional check could be made to ensure that the object was not an explicit struct.

Pothys - MitrahSoft
July 14, 2020, 11:39 PM

Added a test case for this issue.

Michael Offner
August 28, 2020, 11:30 PM

i first was considering to only allow struct in case it also has content, but that could lead to even worse missunderstandings of the functionality, so i reduced the flixibility of the cast in that case, Struct are no longer considered as an array in that case.

Michael Offner
August 28, 2020, 11:31 PM





Zac Spitzer



5.3.8 Sprint 3

Fix versions

Affects versions