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.

Comments

  1. Russell says

    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

  2. says

    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.

  3. Russell says

    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']);

  4. Russell says

    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?

  5. Jim says

    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

  6. Russell says

    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

  7. Gareth Dawson says

    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 Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>