What happened?
Description
Follow-up to #14783
I've updated to the latest version, and the spread operator now works correctly in most situations. However, the issue still occurs if the object being spread into another object comes from a method call on an object.
This one is unrelated to the preloadSingles config.
Steps to reproduce
Minimal contrived example:
{% do entry.addError('foo', 'bar') %}
{% do entry.addError('alice', 'bob') %}
{% dd {
...entry.getErrors(),
three: ['four'],
} %}
This should result in a flat array with keys foo, alice and three, but I'm getting a nested array instead:

Not sure if there are still more conditions where the spread operator doesn't work correctly. Might need some exhaustive testing. Maybe check with function calls and filters as well.
Craft CMS version
4.8.9
PHP version
8.2
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
What happened?
Description
Follow-up to #14783
I've updated to the latest version, and the spread operator now works correctly in most situations. However, the issue still occurs if the object being spread into another object comes from a method call on an object.
This one is unrelated to the
preloadSinglesconfig.Steps to reproduce
Minimal contrived example:
{% do entry.addError('foo', 'bar') %} {% do entry.addError('alice', 'bob') %} {% dd { ...entry.getErrors(), three: ['four'], } %}This should result in a flat array with keys
foo,aliceandthree, but I'm getting a nested array instead:Not sure if there are still more conditions where the spread operator doesn't work correctly. Might need some exhaustive testing. Maybe check with function calls and filters as well.
Craft CMS version
4.8.9
PHP version
8.2
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions