Jump to content

"Argument #2 ($haystack) must be of type array, string given" error when changing from PHP 7.4 to 8.0


Recommended Posts

Posted

When changing PHP from 7.4 to 8.0 I get this error pointing to line 1155 of TraceyDebugger.module.php:

if(in_array('titlePrefix', $this->data['styleAdminType']))

Opening the call stack says that $haystack = 'default'.

I'm running PW 3.0.210 with Tracy 4.24.3.

Not sure whether this is a problem with the module itself or something else in the site.

Posted

I should mention that I get that error in the admin area. If I disable Tracy and then change PHP version to 8, then the admin works OK.

Posted

Actually, it seems like probably something else going on with my set-up. I changed some things to fix a different problem, tried re-enabling Tracy, and it's fine now.

  • 2 weeks later...
Posted

I think you likely upgraded from a very old version of Tracy at the same time you upgraded to PHP 8. When you saved Tracy's config settings, that adjusted the value of $this->data['styleAdminType'] thereby fixing the error.

  • Like 1

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
  • Recently Browsing   0 members

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