I have just updated my live website to Kirby 4. ONe of the block areas is now showing the following error.
Block error: "Kirby\Content\Content::__construct(): Argument #1 ($data) must be of type array, string given, called in /home/user-website/webapps/website/kirby/src/Cms/StructureObject.php on line 38" in block type: "icon-text"
This is the block’s snippet:
<?php $listitems = $block->listitem()->toStructure();
foreach ($listitems as $item):
if ($icon = $item->icon()->toFile()): ?>
<div class="col-11 icon-text" style="background-image: url(<?= $icon->url() ?>);">
<?php endif ?>
<h4 class="yellow"><?= $item->title() ?></h4>
<p><?= $item->text() ?></p>
</div>
<?php endforeach ?>
And the Blueprint
name: Icon Text
icon: grid
label: Icon + text listing
tabs:
content:
fields:
listitem:
label: List Items
type: structure
fields:
icon:
label: Image/Icon
type: files
multiple: false
title:
label: Text
type: text
text:
label: Content
type: writer
styles: fields/settingsColumn
Any reason why I would be getting this message - It wasn’t there in Kirby 3