The problem is the smile_productlabel.option_id field is a foreign key to eav_attribute_option.option_id so attribute values which stored in other tables (e.g. tax_class, directory_country, etc.) can't be saved.
In the Case 1 the option_id = 2, in the Case 2 the option_id = 0 (seems FR converted to 0).
Preconditions (*)
eav_attribute_option
with option_id = 2. (important)Steps to reproduce (*)
Case 1
Case 2
Expected result (*)
Actual result (*)
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (
db_name
.smile_productlabel
, CONSTRAINTSMILE_PRODUCTLABEL_OPTION_ID_EAV_ATTRIBUTE_OPTION_OPTION_ID
FOREIGN KEY (option_id
) REFERENCESeav_attribute_option
(option_id
) ON ), query was: INSERT INTOsmile_productlabel
(product_label_id
,is_active
,name
,attribute_id
,option_id
,image
,position_category_list
,position_product_view
,alt
,display_on
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)Technical details
The problem is the
smile_productlabel.option_id
field is a foreign key toeav_attribute_option.option_id
so attribute values which stored in other tables (e.g.tax_class
,directory_country
, etc.) can't be saved.In the Case 1 the option_id = 2, in the Case 2 the option_id = 0 (seems FR converted to 0).