I'm using Neo blocks as part of an import process and I'm struggling to figure out how to do this via PHP.
The following code snippet (a standard approach of setting the field value with an array which I've used hundreds of times) doesn't seem to work with Neo as it does with Matrix and SuperTable:
$blocks = [ 'new1' => [ 'id' => 'blockid' 'type' => 'somehandle' 'enabled' => true, 'fields' => [ ... ], ] ];
The following snippet was the only way I was actually able to get the parent block to save was:
$field = Craft::$app->fields->getFieldById($entry->myNeoField->fieldId); $entry->setFieldValue('myNeoField', $field->normalizeValue($blocks, $entry)); // Then save the entry
Now I'm really getting nowhere trying to save any blocks within the Neo block. Any help would be appreciated, there doesn't appear to be any documentation for how to do this, nor are there any answers on GitHub or on here.