When saving a new discount with one of the offer types this module adds I kept seeing
Notice: Undefined index: #language in inline_entity_form_cleanup_entity_form_state().
I tracked the problem to commerce_discount_extra_form_commerce_discount_form_alter() and commerce_discount_extra_fix_limit_data(). In both functions we're not digging deep enough in the form array to get the correct 'commerce_offer_limit' element.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 2660016-7.no_offer_limit.patch | 2.53 KB | rszrama |
| #2 | commerce_discount_extra-fixed_language_form-2660016-2.patch | 1.56 KB | michfuer |
Comments
Comment #2
michfuer commentedThis appears to resolve it.
Comment #3
rszrama commentedGood catch, the result of some field reorganization on the form a while ago. Committed!
Comment #5
rszrama commentedAlright, this fix actually opened up a nasty fatal error bug when an empty string was submitted. The issue lies in the fact that you cannot write an empty string to the database, and before this patch, the code that caused the error was never being executed. So... this fix resulted in the exposure of another bug.
There were two issues with this code (not the patch, mind you):
I've rewritten the code accordingly.
Also, this is pretty crummy UX in general, because 0 will work the same as an empty value. Spawning a follow-up issue to update the help text in the suffix.
Comment #7
rszrama commentedRelevant patch attached.