Too few arguments to function Kirby\Panel\Models\Page::toggle()

Hey there.
Real problem, I tried the - great, no question - fieldtoggle plugin. So, in order to use the plugin, I did this:

title: Template title

pages: false
files: false

    label: Title
    type: text
    label: Toggle label
    type: fieldtoggle

But, and I guess this is because I used the blueprint field name toggle, every panel page (that’s using this specific template) that I visited while this field was active, is throwing the following error:

Too few arguments to function Kirby\Panel\Models\Page::toggle(),
0 passed in build/panel/app/src/panel/models/page/changes.php on line 71 and exactly 1 expected

I removed the plugin, checked if the toggle field was present in any content file - nothing. Is this a bug?

The page class has a method called toggle that takes $position as parameter. This error is complaining about the missing argument.

Renaming the field name in your blueprint to something should solve that.

1 Like

As I said before, I removed everything. Blueprint field, plugin, assigned another template, everything, still the error doesn’t go away!

I cannot access the pages, I even tried to create them anew, nothing helps … maybe marvellous plugin creator @thguenther knows something?

I’m pretty sure something was in your cache while you tested it with the removed/renamed blueprint field. There are some names you can not use in the panel, as they are reserved for other functions.

Could you please test it again with a different field name?

Now that you mention cache, here’s the thing:

The site I’m working on resides in a private Bitbucket repo. I didn’t commit or push fieldtoggle (installed as submodule) nor the blueprint. Strangely, the problem persisted after cloning this “untainted” version.

Have you cleared the browser cache? If all else fails, try to install fresh Kirby and Panel folders.

Private mode :dancer:

Do kirby & panel keep some cache of their own? I mean, even if they do, I already did a fresh install via git clone private-bitbucket-repo.git --recursive. Maybe PHP cache? Don’t think my development server (simple php -s localhost:8080) would ever do something like this to me!

Maybe it’s time … to reboot :smile:

Yep, after a while, it just went away … Solved.

I have exactly the same problem. Can you tell me exactly what you did to eliminate the problem? :grin:
Thank you!

Okay, the problem solved itself now! :joy:

Usually, logging in and out again and clearing the browser cache should do the job.

But glad it is solved.