I run Kirby on an Apache via XAMPP and the installation seems to work. I can use the /my-site/panel and created some home, error and searchpages after editing some of the site configs.
Here comes the issue:
When I try to visit the page /my-site/there’s an error and it won’t load. Using the debug mode I am getting an
ErrorException (E_NOTICE)
Undefined variable: class
in \site\snippets\content.php line 1 which reads <article class="margin-bottom-2 <?php echo $class ?>">
I already tried to reinstall everything (aka deleted the whole /kirby/*path and c&p’ed it back from the downloaded zip.
edit: I am using v2.5.12 on a Apache/2.4.37 (Win32) OpenSSL/1.1.1a PHP/7.3.0
I have no idea where it is defined, I did not create any files so far and did not change any code, other than turning off and on the debug mode. Isn’t it supposed to work without changing around stuff?
I am using a template, could that cause the issue?
Yes, a third party theme. It’s called HyperKirby. Sorry, I was not thinking about that this could be the issue. I contacted the author, since it’s a paid service.
It is called from kirby.php:
return $this->;template($page, $data);
public function template(Page $page, $data = array()) {
return $this->component('template')->render($page, $data);
}
it’s loaded in kirby\component\template.php
$result = tpl::load($file, null, $return);
EDIT:
Quick update in case anyone else reads about it here:
Removing E_NOTICE error handling from PHP’s settings (via php.ini) solved it. The issue itself is still there, but it is reported and the author of the above mentioned theme is going to fix it.
This is caused by error E_NOTICE triggering an error on uninitiated variables:
You can turn error E_NOTICE off (optional)
You can initiate variables as empty string $var = '' or null $var = null (depending on their nature) until you assign a proper value later in your code
Being a third party theme, contacting the author directly would get you a release update with a proper fix