I renamed a structure field and called it
media. And then I got “Call to a member function first() on null”. If I change the name to anything it works. Just when using the name “media” I get the error.
$media = $page->media()->toStructure()->first();
Even the .txt have the
media data after I save the page. Really not sure what’s going on… Is the name media() reserved in Kirby and can’t be used?