Closed (duplicate)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Developer experience
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Sep 2011 at 17:32 UTC
Updated:
30 Apr 2012 at 10:00 UTC
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
Comment #1
mr.baileysEven 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.