WP-API / example-client

MIT License
79 stars 20 forks source link

Warning: Invalid argument supplied for foreach() in /example-client/vendor/wp-api/discovery/lib/namespace.php on line 42 #7

Closed larssn closed 4 years ago

larssn commented 8 years ago

This happens when I try to discover pretty much anything.

Vanilla install using composer.

Vinnie-Mac commented 8 years ago

Perhaps there is a misspelled variable or something that isn't declared at the time the for each has been triggered?

larssn commented 8 years ago

Without diving into the code, I'd say the response it parses over, probably has changed in the recent versions of WP-RESTv2.

I get a proper response using a test tool such as Postman.

Vinnie-Mac commented 8 years ago

I was going to say, perhaps running through a proper debugger within PHP Storm or some other form of IDE with that ability could be useful.

I've had a look around and there seems to be a few instances of this error in newer versions of WordPress plugins and what not.

larssn commented 8 years ago

I'll try running it through phpstorm if I have time, but I ended up using PECL OAuth instead.