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.
On Order creation form, if the default adjustment field is left empty( or 0), the order creation will fail, because adjustment field doesn't think 0 is a number.
Attached screenshot is probably the same error but on the adjustment field setting page.
"Amount must be a number." is thrown when the default value is 0.
Comment | File | Size | Author |
---|---|---|---|
adjustment_field_validation_fails_on_0.png | 55.83 KB | skyredwang |
Comments
Comment #2
skyredwangLooks like there are two bugs:
1. adjustment field shouldn't pass to price/number validation when there is nothing/type selected
2. It seems #2684713: WSOD if price amount is NULL still exist, when adjustment field amount is left empty, when "apply order adjustment" is chosen, but the amount is empty. Therefore, WSOD.
Comment #3
steveoliver CreditAttribution: steveoliver at Circatree commented@skyred, See #2840134: Rewrite AdjustmentDefaultWidget to use #ajax.
Comment #4
skyredwangI thought
But, when I create a new price field, the settings page still throw the same error, so I believe something in #2684713: WSOD if price amount is NULL is still not fixed.
Comment #5
skyredwang@steveoliver referenced the '_none' bug in adjustment, this issue is used to track the null bug in Pricing.
Comment #6
bojanz CreditAttribution: bojanz at Centarro for Adapt commentedReproduced this. First time it fails and converts NULL to 0, second time it works cause 0 is a value.
This is coming from the commerce_number form element, and it actually prevents us from saving an empty price.
Doing a test run with the fix in https://travis-ci.org/drupalcommerce/commerce/jobs/189036362.
Comment #8
bojanz CreditAttribution: bojanz at Centarro for Adapt commentedOkay, we now support truly-empty values again.