hack
How to fix the recent errors with TubePress and Vimeo
On 28, Feb 2012 | No Comments | In hack, php, WordPress, WordPress 3.0, WordPress Development | By Andy
I was informed last night that a previously working site using the TubePress WordPress plugin had suddenly started throwing a fatal error.
The error was this
Fatal error: Cannot use object of type stdClass as array in ***/wp-content/plugins/tubepress/sys/classes/org/tubepress/impl/factory/commands/VimeoFactoryCommand.class.php on line 164
After much digging around it turns out to be a problem with the Vimeo API rather than TubePress and a simple fix will sort you out.
You will need to get your hands dirty until TubePress implement this in to the next plugin update.
Open whatever/wp-content/plugins/tubepress/sys/classes/org/tubepress/impl/factory/commands/VimeoFactoryCommand.class.php and on lines 55 and 60 you will see
$this->_videoArray = something
We basically have to recast as an array because for some strange reason Vimeo API is now returning an object.
So. On line 55 change this-
$this->_videoArray = $unserialized->video;
to
$this->_videoArray = (array)$unserialized->video;
And on line 60 change this
$this->_videoArray = $unserialized->videos->video;
to
$this->_videoArray = (array)$unserialized->videos->video;
And you’re done.










Submit a Comment