How to reproduce: Create at least one product class in Ubercart. Change the content type to allow exactly one image per product rather than the default "unlimited". Add a few products, each with an image attached. Create a new product class. All the images in existing products will no longer show up because of a broken SQL statement. The root cause is that inserting a new product class will overwrite the existing field definition and thus create the invalid SQL for any previously inserted products.
The function uc_product_add_default_image_field() should instead test whether the field already exists and if it does, honor the current settings. If it does not exist, it can follow the current strategy and insert a new field with reasonable defaults.
Comments
Comment #1
longwaveI think this is the same as #383330: Product Kit is missing the Image field! (Unknown column 'node_data_field_image_cache.delta') and affects both uc_product and uc_product_kit; I haven't verified the above but if this is guaranteed to reproduce the problem then this is useful to know! This is not critical, however.