Error: Call to a member function getCustomerId() on null

Created on 26 November 2021, over 3 years ago
Updated 23 March 2023, about 2 years ago

Problem/Motivation

We get an error on checkout after the payment on wallee was made and come back to drupal checkout complete step:

Typ 	php
User 	Anonymous (not verified)
Location 	https://www.example.com/commerce_wallee/webhook?gate=8347d782376741a07a7fbaf7d519e686
Message 	Error: Call to a member function getCustomerId() on null in Drupal\commerce_license\LicenseStorage->createFromOrderItem() (line 28 of /example.com/example/webroot/modules/contrib/commerce_license/src/LicenseStorage.php)

#0 /example.com/example/webroot/modules/contrib/commerce_license/src/EventSubscriber/OrderSubscriber.php(189): Drupal\commerce_license\LicenseStorage->createFromOrderItem(Object(Drupal\commerce_order\Entity\OrderItem))
#1 /example.com/example/webroot/modules/contrib/commerce_license/src/EventSubscriber/OrderSubscriber.php(67): Drupal\commerce_license\EventSubscriber\OrderSubscriber->createLicenseFromOrderItem(Object(Drupal\commerce_order\Entity\OrderItem))
#2 [internal function]: Drupal\commerce_license\EventSubscriber\OrderSubscriber->onPaid(Object(Drupal\commerce_order\Event\OrderEvent), 'commerce_order....', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#3 /example.com/example/webroot/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func(Array, Object(Drupal\commerce_order\Event\OrderEvent), 'commerce_order....', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#4 /example.com/example/webroot/modules/contrib/commerce/modules/order/src/OrderStorage.php(147): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Drupal\commerce_order\Event\OrderEvent), Object(Drupal\commerce_order\Event\OrderEvent))
#5 /example.com/example/webroot/modules/contrib/commerce/modules/order/src/OrderStorage.php(108): Drupal\commerce_order\OrderStorage->doOrderPreSave(Object(Drupal\commerce_order\Entity\Order))
#6 /example.com/example/webroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(495): Drupal\commerce_order\OrderStorage->invokeHook('presave', Object(Drupal\commerce_order\Entity\Order))
#7 /example.com/example/webroot/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(657): Drupal\Core\Entity\EntityStorageBase->doPreSave(Object(Drupal\commerce_order\Entity\Order))
#8 /example.com/example/webroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(449): Drupal\Core\Entity\ContentEntityStorageBase->doPreSave(Object(Drupal\commerce_order\Entity\Order))
#9 /example.com/example/webroot/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(801): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\commerce_order\Entity\Order))
#10 /example.com/example/webroot/core/lib/Drupal/Core/Entity/EntityBase.php(339): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object(Drupal\commerce_order\Entity\Order))
#11 /example.com/example/webroot/modules/contrib/commerce/modules/payment/src/PaymentOrderUpdater.php(95): Drupal\Core\Entity\EntityBase->save()
#12 /example.com/example/webroot/modules/contrib/commerce/modules/payment/src/PaymentOrderUpdater.php(59): Drupal\commerce_payment\PaymentOrderUpdater->updateOrder(Object(Drupal\commerce_order\Entity\Order), true)
#13 /example.com/example/webroot/modules/contrib/commerce/modules/payment/src/PaymentOrderUpdater.php(106): Drupal\commerce_payment\PaymentOrderUpdater->updateOrders()
#14 /example.com/example/webroot/core/lib/Drupal/Core/EventSubscriber/KernelDestructionSubscriber.php(51): Drupal\commerce_payment\PaymentOrderUpdater->destruct()
#15 [internal function]: Drupal\Core\EventSubscriber\KernelDestructionSubscriber->onKernelTerminate(Object(Symfony\Component\HttpKernel\Event\TerminateEvent), 'kernel.terminat...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#16 /example.com/example/webroot/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\TerminateEvent), 'kernel.terminat...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#17 /example.com/example/vendor/symfony/http-kernel/HttpKernel.php(100): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\TerminateEvent), 'kernel.terminat...')
#18 /example.com/example/vendor/stack/builder/src/Stack/StackedHttpKernel.php(32): Symfony\Component\HttpKernel\HttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Symfony\Component\HttpFoundation\Response))
#19 /example.com/example/webroot/core/lib/Drupal/Core/DrupalKernel.php(687): Stack\StackedHttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Symfony\Component\HttpFoundation\Response))
#20 /example.com/example/webroot/index.php(22): Drupal\Core\DrupalKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Symfony\Component\HttpFoundation\Response))
#21 {main}

Severity 	Error

Steps to reproduce

Drupal core: 9.2.9
commerce: 8.x-2.28
commerce_license: 2.0.0-beta1
commerce_wallee: 8.x-1.0-beta3

Anyone an idea what exactly the problem is?

πŸ› Bug report
Status

Active

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland handkerchief

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024