Hi, I’m just starting to use KQL on a new project, in which I use many different blueprints and PageModels.
When doing a query to a page without custom pageModel, I get the expected result:
{
query: 'site',
select: {
title: true
}
}
But when I do the same query to a page with a custom pageModel, I get the error from the interceptor:
{
query: 'page("myPage")',
select: {
title: true
}
}
Kirby\Cms\Page::__construct(): Argument #1 ($props) must be of type array, myPageModel given, called in /site/plugins/kql/src/Kql/Interceptor.php on line 254
title
is not a mutating method so I expect that it should not be blocked. So I assume the whole model is blocked. I tried to allow it via the config, but that doesn’t help:
return [
'kql' => [
'classes' => [
'allowed' => [
'myPageModel'
]
]
]
]
I also tried to go through this: Page method is not returning when using Kirby Query Language but I even don’t do it right or don’t properly understand the namespacing-thing it or it’s not up to date with version 2…
The error persists. How can I solve that?
Thank you!
PS: I use ~20 different pageModels, so it would be nice to have the “allowance” to be as simple as possible and it’s also not really an option to get rid of the pageModels.