You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We serialise a MatrixBlockQuery with $field->serializeValue()
We use $entry->setFieldValue('fieldname', $serializedValue) to copy the matrix Block to a different matrix field (of the same type)
Since 4.5.0 the setFieldValue doesnt work anymore. The matrix fields gets created, but the fields are just blank as this function is expecting an array of fields and cannot read the closure
Craft CMS version
4.5.0
PHP version
8.2
The text was updated successfully, but these errors were encountered:
I saw the change was added to provide lazy loading to graphQl queries.
I am implementing a workaround for now with looping through the response from serializeValue() and executing the fields closure, but i would appreciate it if you could make the serializeValue() compatible with the setFieldValue() function. Maybe with an additional parameter $lazyLoad = true in the serializeValue() function?
lukasNo1
changed the title
4.5.0: Matrix serializeValue() closure
[4.5.0]: Matrix serializeValue() fields closure
Aug 23, 2023
Description
Since craft 4.5.0 the Matrix serializeValue() returns the fields a closure rather than an array of fields like in 4.4.*
https://github.com/craftcms/cms/blob/develop/src/fields/Matrix.php#L578
My use case goes something like this:
Since 4.5.0 the setFieldValue doesnt work anymore. The matrix fields gets created, but the fields are just blank as this function is expecting an array of fields and cannot read the closure
Craft CMS version
4.5.0
PHP version
8.2
The text was updated successfully, but these errors were encountered: