Jump to content

[solved] Usage of $page->isChanged('field')


Macrura
 Share

Recommended Posts

PHP Warning: array_key_exists(): The first argument should be either a string or an integer in .../wire/core/Wire.php:954

I'm running an addHookAfter on saveReady to check for changed to some fields, and set some cache fields as a result.

But every time a page is saved (usually by a non-superuser), the above warning is generated..

Some of the fields being checked are text, others are table, or page reference... not sure how to troubleshoot this one...

Link to comment
Share on other sites

1 hour ago, Macrura said:

Some of the fields being checked are text, others are table, or page reference... not sure how to troubleshoot this one...

Perhaps you can use TracyDebugger and output (bd) whatever you pass to isChanged in your hook?

  • Like 1
Link to comment
Share on other sites

tracy didn't help with this, but turned out i was missing a closing parenthesis on one of the dozens of conditions and there was an extra one later, so the api call was triggering the warning, but not any error...?‍♂️

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...