Various commerce entity forms fail to add their submit handlers to the form if a module implementing hook_field_attach_form() adds a function to $form['#submit'].

Cause: an array union is used to merge $form['#submit'] to the commerce submit handler array, ie $a + $b, but index 0 already exists

Found occurrences (could be more):

./modules/customer/includes/commerce_customer_profile.forms.inc:108:  $submit = array();
./modules/order/includes/commerce_order.forms.inc:169:  $submit = array();
./modules/product/includes/commerce_product.forms.inc:74:  $submit = array();
./modules/product/includes/commerce_product_ui.forms.inc:88:  $submit = array();

Comments

mr.baileys’s picture

Status: Active » Closed (duplicate)

Even though this issue is older, I'm going to mark it as duplicate of #1532026: Do not use the array union operator on non-associative arrays since that one has more discussion and a patch.