Hello there,
I am encountering a weird thing on my project. All pages work ok for except one. All of them use the same template and the same controller. I deleted the page an created a new one, but the curse stays with it.
Has somebody encountered something like that? where and how could I find the problem?
This is the controller:
<?php
return function ($page, $pages, $site, $kirby){
#Grab the data from the default controller
$shared = $kirby->controller('site', compact('page', 'pages', 'site', 'kirby'));
#Work on the page specific logic
if($page->heroimage()->exists()){
$heroimage = $page->heroimage()->toFile();
} else {
$heroimage = $page->image();
}
#Create objects for the project navigations
$next = $page->next() ;
$prev = $page->prev() ;
#Create sections on page
$datum = $page->datum();
$client = $page->client();
$details = $page->details();
$text = $page->text();
$documentation = $page->documentation();
return a::merge($shared , compact('heroimage', 'prev', 'next', 'datum', 'client', 'details', 'text', 'documentation'));
};
And the there is the passage where an Error - Call to a member function url() on null - is thrown:
<div class="project-images">
<div class="project-heroimage">
<figure>
<a href="<?= $heroimage->url() ?>">
<img
class="gallery"
src=" <?= $heroimage->resize(1200, 1200)->url() ?>"
alt=" <?= $heroimage->alt() ?>"
>
</a>
</figure>
</div>
Any hint is very much appreciated!