Problem/Motivation

Going to the page where the shipping information is produces a WSOD:


The website encountered an unexpected error. Please try again later.
Error: Call to a member function getPlugin() on null in Drupal\commerce_packeta\Plugin\Commerce\CheckoutPane\PickupCapableShippingInformation::isShipmentPickup() (line 216 of modules/contrib/commerce_packeta/src/Plugin/Commerce/CheckoutPane/PickupCapableShippingInformation.php).
Drupal\commerce_packeta\Plugin\Commerce\CheckoutPane\PickupCapableShippingInformation::isShipmentPickup(Object) (Line: 193)
Drupal\commerce_packeta\Plugin\Commerce\CheckoutPane\PickupCapableShippingInformation::isPickupSelected(Array, Object, Object) (Line: 79)
Drupal\commerce_packeta\Plugin\Commerce\CheckoutPane\PickupCapableShippingInformation->buildPaneForm(Array, Object, Array) (Line: 546)
Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowWithPanesBase->buildForm(Array, Object, 'order_information')
call_user_func_array(Array, Array) (Line: 531)
Drupal\Core\Form\FormBuilder->retrieveForm('commerce_checkout_flow_shipping', Object) (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 219)
Drupal\Core\Form\FormBuilder->getForm(Object, 'order_information') (Line: 143)
Drupal\commerce_checkout\Controller\CheckoutController->formPage(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 159)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 709)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)


Steps to reproduce

$shipment->getShippingMethod() returns NULL and the code wants to get another information of the NULL object:

 $shipment->getShippingMethod()
        ->getPlugin()
        ->getPluginId() === 'packeta';

Execute this condition only when there is a shipping method saved/selected.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

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:

Comments

kaszarobert created an issue. See original summary.

kaszarobert’s picture

Status: Active » Needs review

erik_petra’s picture

Status: Needs review » Fixed
erik_petra’s picture

Status: Fixed » Closed (fixed)