Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.2
Component:
Product
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Apr 2012 at 13:28 UTC
Updated:
14 May 2012 at 10:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
joshmillerAttached is a patch that does what the description above recommends. No idea if it works or really solves the problem :)
Josh
Comment #2
rszrama commentedHmm, interesting. This issue came up before in the Meta tags queue, and the solution never seemed as simple as this.
#1286122: Incompatibility with Commerce
Is there nothing more to be done, like in our entity info hooks or anything?
Comment #3
dippers commentedThis is definetly a bug, array union should not be used on unassociated arrays as the keys are going to clash and in this case the left hand (current value) takes precedence and the right hand is ignored. I can see no reason that the two submit handlers cannot coexist, it's just at the moment the commerce_product_product_form_submit handler is never added to the form.
You might be right that metatags is overzealous in appearing on every entity form but it seems to work quite happily alongside commerce product with this fix in place.
Comment #4
dippers commentedI should add that metatags is currently 'patched' to add its submit handlers in hook_form_alter rather than hook_field_attach_form to get around a problem in core so this issue may reoccurr if/when metatags reverts to hook_field_attach_form.
Comment #5
amateescu commentedI cannot reproduce the initial bug of not being able to save commerce products (with latest metatag, entity api, etc.) but the reasoning and the patch from #1 sounds sane :)
Comment #6
rszrama commentedA quick
grep -rn "+ array(" *turns up this problem on the forms for customer profiles and orders as well. The rest all appear to be unions of associative arrays (price data arrays, permissions arrays, and form arrays). I went ahead and patched 'em all. There may be some leftover that joined non-associative arrays through two variables, but I'm not sure how to best grep for those. This should be good for now.Commit: http://drupalcode.org/project/commerce.git/commitdiff/93ecb9e
Comment #7
mr.baileysMarked #1279300: Entity form submit handlers are not added if hook_field_attach_form() is used as duplicate.