Undefined Method WP_Error::get_item_quantity

Hi there,

I have installed slickr flickr into a local version of WP3.0 and getting the following message:

Fatal error: Call to undefined method WP_Error::get_item_quantity() in /Applications/XAMPP/xamppfiles/htdocs/wp-content/plugins/slickr-flickr/slickr-flickr-public.php on line 107

The page is loading but not pulling the post into the template.

Please could you suggest a way to resolve this?

many thanks, Jim

Answer

Hi Jim,

The get_item_quantity() method is defined in the class file ../wordpress-3.0/wp-includes/class-simplepie.php.

This is part of the standard WordPress install – please can you confirm you have this file? My first suggestion is that this file is missing or is not being loaded.

{ 7 comments… read them below or add one }

Russell July 31, 2010 at 11:34 am

Hi

I will be doing a release that fixes this later today. However that just means you will get a better error message.

For me to investigate please fill in the support form in the sidebar on the Problem Report page or just reply with your Flickr ID, the tag and the URL of the page you are using Slickr FLickr

Russell

empe July 31, 2010 at 10:48 am

Ah.. same with me

Fatal error: Call to undefined method WP_Error::get_item_quantity() in /home/mppers/public_html/wp-content/plugins/slickr-flickr/slickr-flickr-public.php on line 107

the plugins worked well, but now i got the error.

Russell July 28, 2010 at 11:13 am

The current code is:

$rss = fetch_feed($flickr_feed);
$numitems = $rss->get_item_quantity($params['items']);

It must be failing when it tries to fetch the RSS feed – I checked the code and I am not handling the error properly – fetch_feed returns either a feed or an WP_Error object – I am not handling the case where it returns an error. I will fix this in the next release which will be on Saturday.

I need to change the code as follows:


$rss = fetch_feed($flickr_feed);
if ( is_wp_error($rss) ) return "Error fetching Flickr RSS feed".$rss->get_error_message();
$numitems = $rss->get_item_quantity($params['items']);

Russell July 28, 2010 at 10:59 am

I am running too on localhost but on Apache 2.2.4 on Windows Vista and the plugin works fine. What operating system are you on?

Jim July 28, 2010 at 10:51 am

Hi, thanks for the reply.

It seems to be working on a live staging server, but not on localhost.

I do have the simple pie file.

Hmm,

Jim

Russell July 5, 2010 at 7:20 pm

HI Gareth,

This means the call to get your Flickr RSS feed failed.

What is your FlickrID and what tag were you using?

Thanks

Russell

Gareth Dawson July 5, 2010 at 2:17 pm

Receive a similar error

Fatal error: Call to undefined method WP_Error::get_item_quantity() in C:\xampp\htdocs\wordpress\wp-content\plugins\slickr-flickr\slickr-flickr-public.php on line 107

Leave a Comment

CommentLuv badge

Previous post:

Next post: