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.
Discovered in #3093383: Fix the tests on Drupal 8.8-beta1.
// Confirm that the overridden_unit_price flag is preserved.
$this->assertTrue($order_item->isUnitPriceOverridden());
The test is complaining that $order_item->isUnitPriceOverridden() is not a real boolean, which should be impossible. We need to investigate what's going on.
Comment | File | Size | Author |
---|---|---|---|
#3 | 3093398-3-cast-boolean.patch | 2.02 KB | bojanz |
Comments
Comment #2
bojanz CreditAttribution: bojanz at Centarro commentedThis test is highlighting a real problem.
You set TRUE as the value, but as soon as you save it, it becomes "1". TypedData does not cast on load, it's up to us to do that. That means that every boolean getter in Commerce must do a (bool) cast.
Comment #3
bojanz CreditAttribution: bojanz at Centarro commentedSome getters already had the cast. Some didn't. Now unified.
Checked contrib (Recurring, Shipping, Pricelist, Wishlist, etc) and they all seem to have casts.
Comment #5
bojanz CreditAttribution: bojanz at Centarro commentedAnd with that, our build is green again on 8.8 and 8.9