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.
Describe your bug or feature request.
\Drupal\commerce_payment\PluginForm\ManualPaymentAddForm->buildConfigurationForm() contains a call to \Drupal\commerce_order\Entity\Order->getBalance(). The return for this function is listed as \Drupal\commerce_price\Price|null, but the code in buildConfigurationForm() assumes that a Price entity has been returned and attempts to call its isPositive() method. This causes a fatal error if getBalance() has returned (a permissible) NULL value.
Issue fork commerce-3302354
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
MrDaleSmith CreditAttribution: MrDaleSmith at FreelyGive commentedI think the best approach is to throw as exception as we would if the Order itself was missing, as the form itself will serve no purpose without a balance to pay. Created a fork where that happens.
Comment #5
jsacksick CreditAttribution: jsacksick at Centarro commented