If in the checkout process the user does not add any address (like shipping address), when triggering the payment gateway pane of this module, this fatal error is given:

TypeError: Argument 1 passed to Drupal\commerce_paytrail\Repository\FormManager::setPayerFromAddress() must be an instance of CommerceGuys\Addressing\AddressInterface, null given, called in /var/www/html/web/modules/contrib/commerce_paytrail/src/EventSubscriber/FormAlterSubscriber.php on line 48 in Drupal\commerce_paytrail\Repository\FormManager->setPayerFromAddress() (line 478 of /var/www/html/web/modules/contrib/commerce_paytrail/src/Repository/FormManager.php)

#0 /var/www/html/web/modules/contrib/commerce_paytrail/src/EventSubscriber/FormAlterSubscriber.php(48): Drupal\commerce_paytrail\Repository\FormManager->setPayerFromAddress(NULL)

It should return a message forcing the user to input an address.
I also use the commerce_shipping module.

CommentFileSizeAuthor
#2 3149678-2.patch1.21 KBtuutti

Comments

eldrupalista created an issue. See original summary.

tuutti’s picture

StatusFileSize
new1.21 KB

Sorry for the late response. Could you test if this patch fixes the issue for you?

  • tuutti committed 60d1f5a on 8.x-2.x
    Merge branch '3149678' into '8.x-2.x'
    
    Issue #3149678 by tuutti,...
  • tuutti committed ec07dbb on 8.x-2.x
    Issue #3149678 by tuutti, eldrupalista: Fatal error if address is...
tuutti’s picture

This should be fixed in the 8.x-2.4 release.

You can force users to input their address by enabling the Collect billing information setting from your payment gateway settings.

tuutti’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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