in order to use a newer PHP version I tried updating my site’s Kirby Version. I am aiming to push the Kirby version as high as possible but started from 3.5 to 3.6 and with a change of PHP 7.4 to PHP 8.0. Unfortunately I now get the following error in the panel making it impossible to access my pages:
The section "pages" could not be loaded: array_merge(): Argument #3 must be of type array, string given
I already did some digging in the release notes to check whether there are any breaking changes but couldn’t find the culprit as my blueprint seems rather basic to me and I don’t make use of page models.
I validated the yml indentation and no errors were found.
When I delete the Kirby and vendor folders as well as the cache and media folder and reinstall Kirby 3.5 with PHP 7.4 the error is gone. So I assume it must be related to changes made to Kirby from 3.5 to 3.6. Do I need to update my pages in a certain way? I haven’t dealt with the Kirby core but to me it seems the panel is querying all pages and tries to merge them with array_merge in order to show them. If the error message states that one element is string instead of array could that mean there is JSON representation of a page present that doesn’t get decoded?
I now set debug to true and got this additional message in the console:
index.js:1
{status: 'error', message: 'array_merge(): Argument #3 must be of type array, string given', code: 500, exception: 'TypeError', key: null, …}
code: 500
details:
Array(0)
length: 0
[[Prototype]]: Array(0)
exception: "TypeError"
file: "/kirby/src/Panel/Model.php"
key: null
line: 138
message: "array_merge(): Argument #3 must be of type array, string given"
route: "site/sections/([a-zA-Z0-9\\.\\-_%= \\+\\@\\(\\)]+)"
status: "error"
[[Prototype]]:Object
I am running the site locally with PHP. I checked and by default I don’t have error_logs enabled. I’ll look into enabling them to see if there is more info.
My section is now looking like this:
title: Site
sections:
pages:
image: icon
label: Seiten
type: pages
This definitely doesn’t make sense, you are trying to load a section instead of a field here. But if that’s not what is causing the error, maybe there are more templates…
Yes, you are right. I found an initially missed image option in another template that I removed and now everything is working properly. Thanks for the help!