I realise comparing this particular website with all the other WP sites I've built that all the others have the image url in the guid column of the wp_posts table, yet this problem site just has "guid" as the value of the guid column for ALL it's image/attachment entries.
The site still seems to work fine... if I go to the "Media" area of the admin it lists all the uploaded images correctly. I assume the code is looking at the "_wp_attachment_metadata" fields in wp_postmeta to obtain their urls.
Ideally I want to
- know how this happened - ie is this by design in some scenarios? was there a bug in WP at some point causing this?
- Correct the issue replacing these values with the image urls as I have a function that tries to determine the image id of an image from it's url and that fails on this site (based on this code).