Drupal\commerce_payment\PluginForm\PaymentMethodAddForm::buildConfigurationForm() has this twice:

    /** @var \Drupal\commerce_payment\Entity\PaymentMethodInterface $payment_method */
    $payment_method = $this->entity;
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim created an issue. See original summary.

Krzysztof Domański’s picture

eli-on-drupal’s picture

Status: Active » Needs review
eli-on-drupal’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me!

joachim’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/modules/payment/src/PluginForm/PaymentMethodAddForm.php
@@ -105,6 +105,7 @@ class PaymentMethodAddForm extends PaymentGatewayFormBase {
+    $payment_method->setBillingProfile($form['billing_information']['#profile']);

@@ -112,9 +113,6 @@ class PaymentMethodAddForm extends PaymentGatewayFormBase {
-    $payment_method->setBillingProfile($form['billing_information']['#profile']);

The patch moves this to be set earlier.

I have no idea whether it might impact the code in between!

Krzysztof Domański’s picture

FileSize
761 bytes
eli-on-drupal’s picture

Status: Needs work » Reviewed & tested by the community

The latest patch applies perfectly and had no impact on the functionality of the code when I tested it.

bojanz’s picture

Status: Reviewed & tested by the community » Fixed

There was an instance of the same duplication in buildConfigurationForm as well.
Added that to the patch, and committed. Thanks!

Status: Fixed » Closed (fixed)

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