Closed MikeHarrison closed 3 years ago
Hi,
you state that you intent to create custom slugs. Therefore, I assume a problem in that area.
Did you follow the instructions in the README? Does the plugin work as expected without custom slugs? Could you provide the code of your hookPageCreate($page)
method (c.f.)?
The error seems to originate from line 159 in the config.php
file:
$modelName = a::get(Page::$models, $page->intendedTemplate()->name());
I just ran into this problem and it seems it is related to PHP versions: Everything is fine using PHP 7 but PHP 8 throws the above error.
The error occurs as soon as $modelName
is null
in line 161 of config.php
:
https://github.com/steirico/kirby-plugin-custom-add-fields/blob/ba08f4650a9a08dc15b79cf06deafb9a6e0166bb/config.php#L159-L163
Everything works fine again after adding a check if $modelName
is set before checking for the methods' existence.
Hi,
I have installed the plugin, and started working out how to use it to create custom slugs for my pages. I currently have this set in my template:
And when I click to add a page the correct fields are appearing. However when I click
Create Draft
I am getting the following error message:method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given
The draft is created correctly, but something isn't working quite right. If you have any insight that would be great