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

Command icon 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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

MrDaleSmith created an issue. See original summary.

MrDaleSmith’s picture

Status: Active » Needs review

I 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.

  • jsacksick committed fbcda5f on 8.x-2.x authored by MrDaleSmith
    Issue #3302354 by MrDaleSmith: Call to a member function isPositive() on...
jsacksick’s picture

Status: Needs review » Fixed

  • jsacksick committed fb85c19 on 3.0.x authored by MrDaleSmith
    Issue #3302354 by MrDaleSmith: Call to a member function isPositive() on...

Status: Fixed » Closed (fixed)

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