Error while trying to change the status of a page

After I have followed the blog cookbook recipe (https://getkirby.com/docs/cookbook/templating/create-a-blog) an error in the panel keeps me from changing the status of an article to published.

Argument 1 passed to Kirby\Cms\App::extendHooks() must be of the type array, bool given, called in /kirby/src/Cms/AppPlugins.php on line 102

What could be the reason for this behaviour (tested with Kirby v3.4.4)?

Thanks
René

Seems to be the same error as this one here: Error when using require within config.php

Do you have anything similar in your config maybe? Did this issue come up only after updating to 3.4.4?

1 Like

Hi René :wave:

Just to add, since @pixelijn referenced my thread: on my project, there definitely was no error in older 3.x versions (can’t for sure say which, though, as we skipped a few interim releases) – the production system was on 3.4.2 when my client informed me yesterday.

Hey Sebastian :grinning: (it’s nice to meet you here)

I was able to narrow down our issue to changes between v3.3.1 and v3.3.2. With v.3.3.1 everything is working fine using the require_once syntax. After updating to v.3.3.2 it only only works with the alternative require syntax.

Working code snippet (config.php / v.3.3.1):

<?php

return array_replace(
  [
    'ENVIRONMENT' => 'local',
    'debug' => true,
    'languages' => true,
    'slugs' => 'de',
    'smartypants' => true,
    'content' => require_once 'config.content.php',
    'hooks' => require_once 'config.hooks.php',
    'panel' => require_once 'config.panel.php',
    'routes' => require_once 'config.routes.php',
    'text_snippets' => require_once 'config.text-snippets.php',
    'thumbs' => require_once 'config.thumbs.php'
  ],
  F::load(__DIR__ . '/config.deployment.php', [])
);

Working code snippet (config.php / v.3.3.2 / https://github.com/getkirby/kirby/releases/tag/3.3.2):

<?php

return array_replace(
  [
    'ENVIRONMENT' => 'local',
    'debug' => true,
    'languages' => true,
    'slugs' => 'de',
    'smartypants' => true,
    'content' => require __DIR__ . '/config.content.php',
    'hooks' => require __DIR__ . '/config.hooks.php',
    'panel' => require __DIR__ . '/config.panel.php',
    'routes' => require __DIR__ . '/config.routes.php',
    'text_snippets' => require __DIR__ . '/config.text-snippets.php',
    'thumbs' => require __DIR__ . '/config.thumbs.php'
  ],
  F::load(__DIR__ . '/config.deployment.php', [])
);

And to narrow it down even further – it would be enough to replace only the content, hooks and routes paths. So this code snippet is working fine with v3.4.4:

<?php

return array_replace(
  [
    'ENVIRONMENT' => 'local',
    'debug' => true,
    'languages' => true,
    'slugs' => 'de',
    'smartypants' => true,
    'content' => require __DIR__ . '/config.content.php',
    'hooks' => require __DIR__ . '/config.hooks.php',
    'panel' => require_once 'config.panel.php',
    'routes' => require __DIR__ . '/config.routes.php',
    'text_snippets' => require_once 'config.text-snippets.php',
    'thumbs' => require_once 'config.thumbs.php'
  ],
  F::load(__DIR__ . '/config.deployment.php', [])
);

Do you have an idea which change in the newer version is responsible for this?