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?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rszrama created an issue. See original summary.

amateescu’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
957 bytes
52.54 KB

I'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:

bojanz’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me :)

  • rszrama committed 3ffd735 on 8.x-2.x authored by amateescu
    Issue #3179309 by amateescu: Buy X Get Y seems to hang with 0 quantities
    
rszrama’s picture

Thanks! Committed.

rszrama’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.