plain-solutions-gmbh / kirby-form-block-suite

This form plugin for Kirby offers you maximum flexibility and usability. It can be used as a block anywhere you needed. This repository replaces the obsolete version 2.0.
Other
38 stars 11 forks source link

Error while trying to render the form #13

Closed nerdcel closed 1 year ago

nerdcel commented 1 year ago

Hi,

I receive the error 'Block error: "Call to a member function isFilled() on null" in block type: "form"' when I'm trying to render the form. Any Ideas what I am missing here?

My template looks like this: <?= $page->contentblocks()->toBlocks() ?>

Thanks

plain-solutions-gmbh commented 1 year ago

isFilled() is one of the most called methods. Can you see on which file and line this is happens? (Sometimes it is written in the devtool...)

plain-solutions-gmbh commented 1 year ago

But i have a litte hunch. Have you setup some blockfields? Bildschirmfoto 2023-03-07 um 22 44 14

nerdcel commented 1 year ago

Hi,

I use the default formfields, but I just added a textfield with lastname. The error gets thrown at the beginning of the form.php snippet. $form->showForm(). I wonder how $this can be null at this time. Just like the Class is not properly loaded/instantiated.

Maybe good to know. I am using Blade as template engine, maybe it has something to do with it.

nerdcel commented 1 year ago

I got it. There is a regex expression in the Form constructor, to check if the request_uri ist from an api/panel subroute. The regex is a bit to "loose".

For example. In my Case, I was trying to access a route named "/papier/...". So the regex matched at "/papier/.." I'll try to make a pull request to change the regex.

plain-solutions-gmbh commented 1 year ago

🤦‍♂️😂 Software Development holds as such surprises day by day. Sorry man for wasting your time. Thanks for care of it.

nerdcel commented 1 year ago

No worries, you're welcome