Getting an error using the Structure field

I use the Structure field on multiple pages of different websites. Having added a new Structure field to a page, I’m getting an error I haven’t seen before and I can’t figure out what is wrong. (The same website already has two other Structures working perfectly.)

Everything works fine in the Panel but, for thoroughness, the blueprint setup is a follows…

fields:
  bulletin:
    label: Bulletin board
    type: structure
    columns:
      headline:
    fields:
      headline:
        type: text
      text:
        type: writer

I have checked my snippet’s PHP code against the working examples and they are exactly the same except for the field names. I cannot see where the issue is…

<?php $items = $page->bulletin()->toStructure(); $n = 0; foreach ($items as $item): $n++; ?>
<?php if ($item->headline()->isNotEmpty()): ?><h4><?= $item->headline() ?></h4><?php endif ?>
<?php if ($item->text()->isNotEmpty()): ?><?= $item->text() ?><?php endif ?>
<?php endforeach ?>

The error I am getting is as follows…

TypeError thrown with message "Kirby\Content\Content::__construct(): Argument #1 ($data) must be of type array, string given, called in C:\xampp\htdocs\projects\wendoverds\kirby\src\Cms\StructureObject.php on line 38"

Stacktrace:
#26 TypeError in C:\xampp\htdocs\projects\wendoverds\kirby\src\Content\Content.php:55
#25 Kirby\Content\Content:__construct in C:\xampp\htdocs\projects\wendoverds\kirby\src\Cms\StructureObject.php:38
#24 Kirby\Cms\StructureObject:__construct in C:\xampp\htdocs\projects\wendoverds\kirby\src\Cms\Item.php:55
#23 Kirby\Cms\Item:factory in C:\xampp\htdocs\projects\wendoverds\kirby\src\Cms\Items.php:78
#22 Kirby\Cms\Items:factory in C:\xampp\htdocs\projects\wendoverds\kirby\src\Cms\Structure.php:47
#21 Kirby\Cms\Structure:factory in C:\xampp\htdocs\projects\wendoverds\kirby\config\methods.php:258
#20 Kirby\Cms\Core:{closure} in C:\xampp\htdocs\projects\wendoverds\kirby\src\Content\Field.php:78
#19 Kirby\Content\Field:__call in C:\xampp\htdocs\projects\wendoverds\site\snippets\banner_home.php:23
#18 include in C:\xampp\htdocs\projects\wendoverds\kirby\src\Filesystem\F.php:425
#17 Kirby\Filesystem\F:loadIsolated in C:\xampp\htdocs\projects\wendoverds\kirby\src\Filesystem\F.php:364
#16 Kirby\Filesystem\F:Kirby\Filesystem\{closure} in C:\xampp\htdocs\projects\wendoverds\kirby\src\Filesystem\F.php:372
#15 Kirby\Filesystem\F:load in C:\xampp\htdocs\projects\wendoverds\kirby\src\Toolkit\Tpl.php:36
#14 Kirby\Toolkit\Tpl:load in C:\xampp\htdocs\projects\wendoverds\kirby\src\Template\Snippet.php:172
#13 Kirby\Template\Snippet:factory in C:\xampp\htdocs\projects\wendoverds\kirby\config\components.php:301
#12 Kirby\Cms\Core:{closure} in C:\xampp\htdocs\projects\wendoverds\kirby\src\Cms\App.php:1553
#11 Kirby\Cms\App:snippet in C:\xampp\htdocs\projects\wendoverds\kirby\config\helpers.php:531
#10 snippet in C:\xampp\htdocs\projects\wendoverds\site\templates\home.php:4
#9 include in C:\xampp\htdocs\projects\wendoverds\kirby\src\Filesystem\F.php:425
#8 Kirby\Filesystem\F:loadIsolated in C:\xampp\htdocs\projects\wendoverds\kirby\src\Filesystem\F.php:364
#7 Kirby\Filesystem\F:Kirby\Filesystem\{closure} in C:\xampp\htdocs\projects\wendoverds\kirby\src\Filesystem\F.php:372
#6 Kirby\Filesystem\F:load in C:\xampp\htdocs\projects\wendoverds\kirby\src\Toolkit\Tpl.php:36
#5 Kirby\Toolkit\Tpl:load in C:\xampp\htdocs\projects\wendoverds\kirby\src\Template\Template.php:163
#4 Kirby\Template\Template:render in C:\xampp\htdocs\projects\wendoverds\site\plugins\minify-html\index.php:18
#3 MinifyHTML:render in C:\xampp\htdocs\projects\wendoverds\kirby\src\Cms\Page.php:1017
#2 Kirby\Cms\Page:render in C:\xampp\htdocs\projects\wendoverds\kirby\src\Cms\App.php:777
#1 Kirby\Cms\App:io in C:\xampp\htdocs\projects\wendoverds\kirby\src\Cms\App.php:1191
#0 Kirby\Cms\App:render in C:\xampp\htdocs\projects\wendoverds\index.php:5

Can anyone identify the problem? Thanks.

This error was reported in another thread, but only in the context of a structure field within a custom block and only for already existing structures. Could you please post what is stored in the structure in your content file?

Hi, Sonja. This is the relevant text from the content file…

----

Bulletin:

- 
  headline: Family Support Group Workshop, 10.00am-12.00pm on Saturday 6th January at Wendover Christian Centre
  text: '<p>For the sons and daughters of our visitors. Please RSVP if you would like to attend. <a href="https://wendoverds.org.uk/assets/content/Documents/News/FSG_6%20Jan%202024.jpg" target="_blank">View poster</a></p>'
- 
  headline: Please note the Monday Club Cafe reopens on the 8th January
  text: ""
- 
  headline: Weekly Let's Get Moving Sessions, 1.45pm on Thursdays at New Hall, Pugin Rooms, Marlow, SL7 1NQ
  text: '<p>Specifically designed to get all older people, including those with dementia, moving and functioning better. Suggested £3 donation. <a href="https://wendoverds.org.uk/assets/content/Documents/News/Lets%20Get%20Moving.png" target="_blank">View poster</a></p>'
- 
  headline: Tuesday Tunes, 10.00-11.30am at Aylesbury Library
  text: '<p>The first Tuesday of every month. A toe-tappingly fantastic service for anyone who loves music. <a href="https://wendoverds.org.uk/assets/content/Documents/News/%23Tuesday%20Tunes%20date.pdf" target="_blank">View poster</a></p>'
- 
  headline: Weekly Memory Cafe in Waddeson, 1.30-3.30pm on Fridays at Waddeson Community Centre, HP18 0LX
  text: '<p>You’re invited to come and enjoy coffee, cake and good company at our friendly and informal memory cafe. <a href="https://wendoverds.org.uk/assets/content/Documents/News/Memory%20Cafe%20Poster.png" target="_blank">View poster</a></p>'

----

I haven’t yet figured out why but this issue has resolved itself.