kirby-template-hooks
kirby-template-hooks copied to clipboard
TypeError when updating a file
Whenever I update a file I get this error:
Exception: TypeError Kirby\Cms\App::{closure}(): Argument #2 ($input) must be of type array, null given
So apparently Kirby doesn't always send input. Also the plugin does not use the $input argument, so I think it's best to make it optional. I'll submit a PR in a second.
I had the same problem and the fix for me was renaming the $input argument to $values, like in the doc (https://getkirby.com/docs/reference/plugins/hooks/file-update-before)
Apparently you have to use the correct names for arguments. I found it via this post in the forum: https://forum.getkirby.com/t/receiving-null-instances-in-kirby-hook/20352/4