I am adding a product display with multiple product variations. After I add my first product variation, each subsequent product is automatically populated with the image from the initial product variation. I am allowed to remove the image and upload a new image. And save the new product variation. But when I go to save the product display it throws this error and doesn't save anything:

Notice: Trying to get property of non-object in file_field_presave() (line 220 of /home/fromthee/public_html/modules/file/file.field.inc).
Notice: Undefined property: stdClass::$uri in file_save() (line 570 of /home/fromthee/public_html/includes/file.inc).
Notice: Trying to get property of non-object in file_field_presave() (line 220 of /home/fromthee/public_html/modules/file/file.field.inc).
Notice: Undefined property: stdClass::$uri in file_save() (line 570 of /home/fromthee/public_html/includes/file.inc).
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'uri': INSERT INTO {file_managed} (filesize, status, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 0 [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => 1339704961 ) in drupal_write_record() (line 7013 of /home/fromthee/public_html/includes/common.inc).

If I save the product display after adding each product variation, the module works as expected. Each additional product is not pre-populated with an image from the 1st product. And no error messages.

Comments

bojanz’s picture

Title: Uploading different images for product variations breaks module » Regression: Uploading different images for product variations breaks module
Status: Active » Fixed

This regression was caused by a single character typo ($form_state instead of &$form_state) in #1626706: Rework entity type specific code into controllers :/
Committed a fix.
Test the June 16th -dev when it gets generated, and let me know if you encounter any problems. I will tag a beta3 soon.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.