In our installation, if you go to the discount edit page, open the inline for to edit an existing coupon, and click Save Discount without saving or canceling the edit on the coupon first, you get a PDO error.

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1: INSERT INTO {field_data_commerce_coupon_conditions} (entity_type, entity_id, revision_id, bundle, delta, language, commerce_coupon_conditions_condition_name, commerce_coupon_conditions_condition_settings) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, ); Array ( [:db_insert_placeholder_0] => commerce_coupon [:db_insert_placeholder_1] => 3628 [:db_insert_placeholder_2] => 3628 [:db_insert_placeholder_3] => discount_coupon [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => ) in field_sql_storage_field_storage_write() (line 514 of /var/www/sites/prod/html/modules/field/modules/field_sql_storage/field_sql_storage.module).

Don't know if it's coupon or discount that's responsible here, but based on the above it looks like something is broken with placeholder 6 (commerce_coupon_conditions_condition_name) in the query?

Also saw

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'commerce_coupon_recipient_target_id' at row 1: INSERT INTO {field_data_commerce_coupon_recipient} (entity_type, entity_id, revision_id, bundle, delta, language, commerce_coupon_recipient_target_id) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array ( [:db_insert_placeholder_0] => commerce_coupon [:db_insert_placeholder_1] => 4734 [:db_insert_placeholder_2] => 4734 [:db_insert_placeholder_3] => discount_coupon [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => ) in field_sql_storage_field_storage_write() (line 514 of /var/www/sites/prod/html/modules/field/modules/field_sql_storage/field_sql_storage.module).

which makes me think it's related to the empty recipient field, which I believe is provided by the base commerce_coupon module as well? Thanks for any help and let me know if I need to provide more info!

Comments

scotself created an issue.

mdjamiruddin’s picture

I am also facing exactly the same issue in Drupal 7 project. Yes, it is, I think, in the base commerce_coupon module. If anyone can help me it would be appreciable.