A long time ago I made a site with Kirby 1. Today I tried to upgrade to Kirby 2.1.1 and followed the upgrade instruction on the site. All content loads fine except content that contains images. With the debug config option (from Kirby 1) I get this:
Undefined property: File::$value in /kirby/core/kirbytext.php on line 39
I’ve tried redownloading the latest version, redoing the steps and trying all possible paths. If I add a new image to some content with only text it won’t show up either. Any help would be appreciated.
What syntax are you using in your content files?
Yes, every image uses this:
(image: name-2.jpg), etc
Try to hit ENTER after each “(image: name-x.jpg)” in the panel!
The text after each “(image: name-x.jpg)” in the content files is ignored.
Thanks I’m aware of that. Maybe I wasn’t clear enough. This is what my text (content) file looks like. I don’t think the problem lies there…
Title: Project name
Description of image 1
Description of image 2
Text: Project description
Please show the line(s) of your template file, which show(s) the content of the field “image”.
The div.image remains empty when the page is loaded even though there is some text (image descriptions) inside the image field.
<?php echo kirbytext($page->image()) ?>
<?php echo kirbytext($page->text()) ?>
Do your files have meta data files (like
Nope, everything is as simple/basic as possible.
Then that’s really strange…
Could you please try setting up the Kirby 2 starterkit on the same server to make sure that your site and its content aren’t responsible for the error?
I’ve tried it and uploaded the starterkit to the server. The example kirby site and panel looks and works perfectly. So that’s can’t be it.
I thought maybe it’s in my browser somehow but resetting it gave no improvements either. Also took my website down and created a simple html page with some images. That worked but as soon as I put the kirby folders back in it breaks again. Putting an img directly into the html in one of the snippets, same thing. Any other ideas?
Try to rename the field from “image” to something else.
$page->image() is a native Kirby method, so your method probably interferes with this.
Thank you, that fixed it!