Blueprint Issues after Kirby2 to 3 upgrade

Hi folks,

I’m upgrading a project to Kirby 3 and now get issues with the blueprints that I couldn’t find a solution for. So hopefully someone can help me out here or give me a hint.

If you need more info, let me know what exactly I should provide as well.

On panel pages (actually all of the pages get redirected to /panel/site) I get the following error:

The section “pages” could not be loaded: Kirby\Cms\Blueprint::extend(): Return value must be of type array, int returned

site.yml:

title: Site
columns:
- width: 1/2
	sections:
		pages: true
- width: 1/2
	fields:
		title:
			label: Title
			type:  text

Thanks for any hint.
Anselm

The indentation of the - width parameter is wrong, if this is not a copy/paste error.

Also, you have to remove the title field, the title is added automatically, therefore a field named title must not be present.

You cannot set a section to true.

title: Site
columns:
  - width: 1/2
    sections:
      pages:
        type: pages
        # other section options here  
  - width: 1/2
    fields:
      # fields here but no title field

@pixelijn Thanks, forgot about the title issue again. Unfortunately, this isn’t solving the described error. I even took your example as the site.yml blueprint and it outputs the exact same error as before. So I assume the issue is somewhere else than the blueprint itself?

If the code @pixelijn posted is the only code in your site.yml, then it should work.

It’s the only code I currently use. It’s still returning the same error. That’s why I think it must have to do something with the upgrade, however I have no clue where to start. I used the upgrade guide and the project doesn’t have too much custom stuff in there anymore.

Unfortunately, I don’t have any starting point for debugging this here now. If anyone has an idea, let me know.

I now tried again to use only the site.yml from starterkit. It results in the same error, also when flushing content from site.txt file.
I reinstalled the kirby folder via composer as well (3.5) so not sure what else I could do now.

Hm, I wonder if there are problems in other pages’ blueprints that are loaded through the pages section.

The error seems to point to an extend property used in one of the blueprints.

Yep, that was the hint that helped, thanks! It was in one of the pages/a.yml blueprints and an indentation issue in there:

incorrect (issue made visible by wrong tab indent):

sections:
	pages:
		type: pages
	flip: true
	limit: 999
	title:
		…

correct:

sections:
	pages:
		type: pages
    	flip: true
    	limit: 999
	title:
		…

What I still don’t understand is that there’s no extend property used anywhere so far and it made the entire panel non-working, even though this error was just in one of the many blueprints.

Could this be improved, either in the error reporting or better in the way how blueprints are loaded individually?

Kirby has to read the blueprints of stuff it loads, for example, to determine if a page may be shown in a section or not (think read: false).

The error message at least gave a hint what was wrong, and I think it probably refers to some sort of inner extending happening here without you actually having to extend something explicitly in a blueprint. But yes, the error message could be improved.

It’s something that is also worth a note in the docs.

1 Like