Roots Wrapper Override: PHP Warning & Overrides not working

Hi Nick & Roots Community,

I’m having trouble making the override work with Roots 6.5.0 and I’m getting the following PHP Warning:

Warning: Invalid argument supplied for foreach() in /.../wp-content/plugins/roots-wrapper-override/src/plugin.php on line 176

I’ve deactivated all my plugins just in case and the issue persists.

I dug through the code as best as I could and have found that moving the following assignment from line 44 to the beginning of the __construct function fixes this issue

self::$overrides = $overrides; // and setup our default overrides.

It is probably specific to my PHP setup but I have the same issue on my production server, so I suspect others might run into it as well. Generally, I can’t use a variable before I define it although I know in some environments that can be possible :smile:

Do let me know if there is something wrong with my setup and this in a non-bug

I’m still a n00b with server setup so maybe I messed something up (I recently switched from shared hosting to VPS and I’ve started messing with my local MAMP install as well :smiley:)

Thanks,

Tamara

Hi Tamara,

This wasn’t your fault, the bug was reported and fixed the same day. Can you please make sure you are using the latest version of the plugin please. It’s 0.9.1 you need and the zip should be roots-wrapper-override-0.9.1-final.zip. There was an email sent out Tuesday with the update, and you should be available to download via Gumroad as well.

If you have any issues after installing that, my contact details are in docs/email.

Thanks,

Nick

Thanks Nick! That’s pretty embarrassing :blush:
I had downloaded both updates right away, but I guess the confusion ended up being that I the version number didn’t change and I had forgotten to update the plugin in this particular project.

Thanks for your time :smile:

You’re very welcome. I’ll close this topic now. Feel free to PM or email me if any other issues arise.