Closed corneliusio closed 1 week ago
I'm needing to populate a neo field with multiple blocks in Craft 4.x, however only the first block is ever saved. This does not appear to be an issue in Craft 5.x.
This didn't use to be an issue but I'm not sure when it started.
$entry = Entry::find()->section('sectionHandle')->one(); $entry->setFieldValue('fieldHandle', [ [ 'modified' => 1, 'type' => 'blockType', 'enabled' => 1, 'collapsed' => 0, 'level' => 1, 'fields' => [ // … ], ], [ 'modified' => 1, 'type' => 'blockType', 'enabled' => 1, 'collapsed' => 0, 'level' => 1, 'fields' => [ // … ], ], ]); Craft::$app->elements->saveElement($entry);
In the above example only the first block is saved but would expect to have two blocks.
4.2.4
4.10.2
Only save blocks to the site they were created in
This is not a templating issue
Noting that this is also happening for a non-multisite setup with no propagation method.
Thanks for reporting that - fixed now in 4.2.5.
Bug Description
I'm needing to populate a neo field with multiple blocks in Craft 4.x, however only the first block is ever saved. This does not appear to be an issue in Craft 5.x.
This didn't use to be an issue but I'm not sure when it started.
Steps to reproduce
Expected behaviour
In the above example only the first block is saved but would expect to have two blocks.
Neo version
4.2.4
Craft CMS version
4.10.2
What is the affected Neo field's propagation method?
Only save blocks to the site they were created in
Does this issue involve templating, and if so, is eager-loading used?
This is not a templating issue