- Issue created by @mydot
- 🇮🇳India anweshas Kolkata
Picking this up, I’ll work on a patch/MR to address the undefined array key error.
- 🇭🇺Hungary djg_tram
The first, quick idea is to change
$profile_name = $pane_form['pickup_profile'] ? 'pickup_profile' : 'shipping_profile';
to
$profile_name = isset($pane_form['pickup_profile']) ? 'pickup_profile' : 'shipping_profile';
Could you quickly try this?
The new dev version is working now.
In the meantime i found an other bug what appeared with the 1.0.2 version. It shows up on the order shipment edit form:
Error: Call to a member function get() on null in Drupal\commerce_shipping_pickup_api\ProfileFieldCopyWithoutPickup->supportsForm() (line 25 of modules/contrib/commerce_shipping_pickup_api/src/ProfileFieldCopyWithoutPickup.php).
I would suggest to place two conditions after line $order = self::getOrder($form_state);
if (!$order) {
return FALSE;
}if (!$order->hasField('shipments')) {
return FALSE;
}- 🇭🇺Hungary djg_tram
Is it really possible to not get a valid order here? It sounds a bit strange... Anyway, I would suggest to leave the parent call even then and use
$order = self::getOrder($form_state); if ($order && $order->hasField('shipments')) { foreach ($order->get('shipments') as $shipment_item) { /** @var \Drupal\commerce_shipping\Entity\ShipmentInterface $shipment */ $shipment = $shipment_item->entity; $plugin = $shipment->getShippingMethod()->getPlugin(); if ($plugin && str_contains($plugin->getPluginId(), 'pickup')) { return FALSE; } } }
I tried it with your pickup store submodule too, with the same result. But Your suggestion is working.
- 🇮🇳India anweshas Kolkata
Thanks for the quick follow-up and fixes. Confirming this is resolved in 1.0.3.