Filename cannot be empty

Suddenly I’ve been getting this error:
file_get_contents(): Filename cannot be empty

Which points to mything\kirby\vendor\getkirby\toolkit\lib\media.php, line 165:

    $this->content = file_get_contents($this->root);
}```

First time I've seen this issue and this is the more or less the default starter theme with changed CSS and a few SEO additions in the header snippet. This in particular seems to be connected to either pages with subpages or pages with media. For the latter I actually removed all images from all pages and post types, and removed any snippet in the template files which try to fetch images and other media (such as the coverimage default one).

For a while I couldn't access `/blog` but I could access `/projects`. I started going through `/blog` and removing all images from the subpages and any image/media related snippets in them. Then I could access `/blog` just fine but not any subpages and NOT `/projects` with was working just fine prior to the changes.

And another local fresh install with the starter kit works just fine.

Any suggestions?

Well, without knowing what you have changed that caused the error message, I’m afraid it’s impossible to reproduce :thinking:

Yeah, I completely understand that and I feel kinda icky asking a question like it… However, progress!
After some further investigation it seemed to have something to do with the prevnext.php snippet which is unaltered. However, one thing that I have done which I normally don’t is to rename the images folder to just img which resulted in broken assets: <?php echo (new Asset("assets/images/arrow-{$directionPrev}.svg"))->content() ?>.

Updating those paths and the errors are gone.

1 Like