Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 CreditAttribution: michfuer at Centarro commentedThis appears to resolve it.
Comment #3
rszrama CreditAttribution: rszrama at Centarro commentedGood catch, the result of some field reorganization on the form a while ago. Committed!
Comment #5
rszrama CreditAttribution: rszrama at Centarro 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 CreditAttribution: rszrama at Centarro commentedRelevant patch attached.