<g:image_link> fix

Project: 
Google Base RSS
Category: 
bug report
Priority: 
normal
Status: 
patch (needs review)

Quote:
Hello Luke,

Thank you for participating in Google Base. We've recently reviewed your
items and noticed they contain errors. Because of these errors, we've
temporarily removed your items from the search results. Please correct the
following problems with your items:

Issues:

- Bad image_links

-----------------
- Bad image_links: The image_links in your data feed aren't working
correctly. Please check that all the image links in your feed are working,
or we'll be unable to display your items' images. If an item doesn't
contain an image, please leave this attribute blank.

After you've corrected the errors, please upload a new version of your
data feed with the same filename. We'll notify you if any additional
corrections are needed.

Sincerely,

The Google Team

Here is an update to the image code that should fix the problem if others aren't getting images listed and all.

<?php
   
if (isset($product->field_image_cache) && file_exists($product->field_image_cache[0]['filepath'])){
     
$output .= '<g:image_link>' . check_url(file_create_url($product->field_image_cache[0]['filepath'])) . '</g:image_link>';
    }
?>