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.
If you enter a 0 quantity for the "buys" section of a Buy X Get Y promotion, it seems to result in a fatal error. I'm not getting any log messages, just a consistent fatal error if I set the quantity to 0.
It's not entirely clear why we don't require a positive numeric value for the "buy" or "get" quantity on this offer type. Is there a reason we shouldn't be validating these to ensure a >= 1 value?
Comment | File | Size | Author |
---|---|---|---|
#2 | Screenshot_2020-11-06 Edit Test commerce_dev.png | 52.54 KB | amateescu |
#2 | 3179309.patch | 957 bytes | amateescu |
|
Comments
Comment #2
amateescu CreditAttribution: amateescu at Centarro commentedI've tested this and can't reproduce the fatal error, but it doesn't make sense to have a value lower than 1 for either X or Y quantities, so this simple patch should be enough.
There's no existing functional test coverage for that form, and I don't think it's necessary to add one here, I tested it manually and this is the validation error you get with the patch:
Comment #3
bojanz CreditAttribution: bojanz commentedLooks good to me :)
Comment #5
rszrama CreditAttribution: rszrama at Centarro commentedThanks! Committed.
Comment #6
rszrama CreditAttribution: rszrama at Centarro commented