uoregon / WPSpin

A WordPress plugin providing integration with Spinitron's SpinPAPI API service.
GNU General Public License v2.0
3 stars 5 forks source link

nowplaying_collection.js loadAjax function JSON parse failing? #8

Closed sdunham closed 11 years ago

sdunham commented 11 years ago

First off, thanks for the work you've done on this! Trying to implement this plugin for my school radio station's website, and I'm having an issue with the "Now on Air" functionality. When nowplaying_collection.js tries to parse the returned JSON (line 22), it errors out.

I can see that the appropriate JSON was returned in chrome's dev tools, but the actual data variable that the function tries to parse doesn't appear to contain the JSON. Instead, it contains the following error message/markup:

<br /> <b>Catchable fatal error</b>: Argument 1 passed to WPSpin\ShowModel::getShowDJs() must be an instance of WP_Post, instance of stdClass given, called in /path/to/wordpress/wp-content/plugins/WPSpin/models/showmodel.php on line 59 and defined in <b>/path/to/wordpress/wp-content/plugins/WPSpin/models/showmodel.php</b> on line <b>92</b><br />

Any thoughts on what's going on? Am I doing something wrong in the setup, or is this a known issue?

Pythagory commented 11 years ago

Not a known issue. What version of Wordpress are you running on? Also, if you know, what version of PHP?

sdunham commented 11 years ago

Totally didn't notice I was using an older instance of WP. I upgraded to the current version (3.5.1), and it's generally working now. I'm seeing one or two other odd issues, but I'll play around a bit more and submit separate issues later if needed. Sorry for the unnecessary issue!

In case you're still interested, here's what I was running: WordPress = 3.4.2, PHP = 5.3.15

Pythagory commented 11 years ago

Good to hear you got it (mostly) working. Thanks for the feedback and don't be shy about submitting more issues as you use it.