diff --git a/payment/src/Plugin/Payment/Method/PaymentMethodBase.php b/payment/src/Plugin/Payment/Method/PaymentMethodBase.php index d7da5c4..bb5c952 100644 --- a/payment/src/Plugin/Payment/Method/PaymentMethodBase.php +++ b/payment/src/Plugin/Payment/Method/PaymentMethodBase.php @@ -348,9 +348,10 @@ abstract class PaymentMethodBase extends PluginBase implements AccessInterface, protected function executePaymentAccessEvent(AccountInterface $account) { $event = new PaymentExecuteAccess($this->getPayment(), $this, $account); $this->eventDispatcher->dispatch(PaymentEvents::PAYMENT_EXECUTE_ACCESS, $event); + $access_results = $event->getAccessResults(); // If there are no results, grant access. - return $event->getAccessResults() || in_array(self::ALLOW, $event->getAccessResults(), TRUE) && !in_array(self::KILL, $event->getAccessResults(), TRUE); + return empty($access_results) || in_array(self::ALLOW, $access_results, TRUE) && !in_array(self::KILL, $access_results, TRUE); } /** diff --git a/payment/src/Tests/QueueWebTest.php b/payment/src/Tests/QueueWebTest.php index e94d373..45a124a 100644 --- a/payment/src/Tests/QueueWebTest.php +++ b/payment/src/Tests/QueueWebTest.php @@ -61,7 +61,7 @@ class QueueWebTest extends WebTestBase { $this->paymentMethodManager = \Drupal::service('plugin.manager.payment.method'); $this->paymentStatusManager = \Drupal::service('plugin.manager.payment.status'); $queue_id = $this->randomName(); - $this->queue = new Queue($queue_id, $this->database, \Drupal::moduleHandler(), \Drupal::service('event_dispatcher'), $this->paymentStatusManager); + $this->queue = new Queue($queue_id, $this->database, \Drupal::service('event_dispatcher'), $this->paymentStatusManager); } /**