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.
The problem with commerce_coupon_code_is_valid() function is that if the code is invalid, we do not set error message in global $commerce_coupon_validation_error_message;.
// if no such coupon found, the $code is invalid
if (!is_object($coupon)) {
return FALSE;
}
This causes inconsistency in error handling that is fairly easy to fix.
Comment | File | Size | Author |
---|---|---|---|
#4 | commerce_coupon-error-message-for-invalid-code-1885876-4.patch | 496 bytes | Samvel |
#1 | commerce_coupon-1885876-error-message-for-invalid-code.patch | 414 bytes | ygerasimov |
Comments
Comment #1
ygerasimov CreditAttribution: ygerasimov commentedPatch attached.
Comment #2
pcambraThanks for the patch, fixed
Comment #4
Samvel CreditAttribution: Samvel commentedHello guys,
Seems patch was not applied correctly and i see error in variable name.
I still haven't any error messages if i enter invalid coupon code.
Patch attached, please review.
Comment #5
mdupree CreditAttribution: mdupree as a volunteer and at Acro Commerce commentedThis issue seems to be implemented in (atleast in the sense of error message on invalid coupon)
Commerce Coupon 7.x-2.x
Comment #6
mdupree CreditAttribution: mdupree as a volunteer and at Acro Commerce commented