Please provide more information, particularly the code where the $file variable is used (if it comes from the snippet, the culprit is probably inside the snippet).
Yep, I was wondering about the $section->section()
It is a Kirby 2 template and worked there.
The sections are listed. How would I have to address them in Kirby 3?
But the question is what this returns. You have to make sure that this doesn’t return null. The snippet method expects a string or an array as parameter.
However, I will create an issue on GitHub, because the undefined variable error shouldn’t happen and should be catched.
This line has now an error, must be children() not children, but that was correct in your example above.
I assume $section correctly returns a Page object, but you haven't anwered my question what $section->section()->value()` returns. Disable the call to snippet and output
This gets you all pages of your site, not just the first level pages, and I somehow doubt this is what you want and probably not all pages have that section() field defined.
You probably want either $page->children()->listed() or $pages->listed()
The problem was caused by a mismatch of default language and content file language code extensions, resulting in empty field values being passed to the snippet helper.