Changing my editor field to type: blocks
didn’t convert the my data (maybe because I had some custom editor fields?), so I followed the adding blocks guide to convert my editor entries to the new blocks field. However, it wasn’t till I found this topic that I discovered the ->toArray()
method which allowed the conversion to finally work. So everything in this cookbook recipe worked except I had to change the last lines to…
$page->update([
'text' => $blocks->toArray(),
]);
Was it because I was using pretty:true
in my blueprint? I tried with and without that setting, but needed toArray()
to get it to work.
Edit: don’t know if it’s related but when I tried to dump($blocks);die;
in the recipe I got a blank screen, but when I used dump($blocks->toArray());die;
I actually saw the data. Is my toBlocks()
not working in this instance? I tried removing the editor plugin but didn’t seem to make a difference.