[wp-hackers] image attachment bug? (was Re: Featured image functionality dissapeared from custom post types after upgrade)

andre at pixelplexus.co.za andre at pixelplexus.co.za
Thu Jul 19 21:26:18 UTC 2012


I found  older posts didn't have the meta value '_wp_attached_file'.
Running through them and calling update_attached_file solved my problem.

Just wondering if that shouldn't be happening, or at least attempted in
wp_get_attachment_image or somewhere else in the attachment retrieval
chain, in stead of it just returning a empty string? (provided with a
correct id and the file does exist)

Effectively I had a situation where the trusty template tags were telling
me "yes we have an attachment, but you can't see it, have it or use it"

Wondering, am I missing something or should I be filling it for review?



> I'm completely baffled. All 1088 of the cutom posts return true for
> has_post_thumbnail and get_post_thumbnail_id returns the correct id.
> But for about 600 of them get_the_post_thumbnail returns blank.
> Any pointers or ideas would be very much appreciated :-|
> Thanks
> André
> PS. clarifying the below: On the custom post's editing screen the featured
> image doesn't show in the meta box. But the fact that the 'use as featured
> image' link is missing from the image in the media gallery tab seems to
> sugest the right image is set as featured but the image is somehow
> 'borken'.
>> Hi
>> I see a couple of mentions of similar problems on the forums but no
>> detail
>> of what the problem might be or how to fix. So asking here and will
>> start
>> digging.
>> A site that uses featured images on a custom post type. After upgrade to
>> 3.4.1 when you go to the edit screen for *some* of the custom posts, the
>> featured image is no longer set. If you click on set featured image
>> there
>> is still an image listed in the 'gallery' tab. However there is no 'set
>> as
>> featured link' and the image thumbnail seems blank. Full size lists the
>> image size as (0 × 0). (so suspect something broken in the db :-| (Got
>> exactly the same result on a clone of the site)
>> Will go through disabling all plugins etc. but its weird that it was
>> working perfectly before the upgrade.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list