After updating, I get the following error when viewing an order (that doesn't have a shipment on it):
RuntimeException: Could not load the "" shipment type. in Drupal\commerce_shipping\Entity\Shipment::bundleFieldDefinitions() (line 708 of modules/contrib/commerce_shipping/src/Entity/Shipment.php).
Drupal\Core\Entity\EntityFieldManager->buildBundleFieldDefinitions('commerce_shipment', '', Array) (Line: 350)
Drupal\Core\Entity\EntityFieldManager->getFieldDefinitions('commerce_shipment', '') (Line: 68)
Drupal\og\OgGroupAudienceHelper->getAllGroupAudienceFields('commerce_shipment', '') (Line: 46)
Drupal\og\OgGroupAudienceHelper->hasGroupAudienceField('commerce_shipment', '') (Line: 287)
Drupal\og\Og::isGroupContent('commerce_shipment', '') (Line: 237)
og_entity_create_access(Object, Array, '')
call_user_func_array('og_entity_create_access', Array) (Line: 403)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_create_access', Array) (Line: 251)
Drupal\Core\Entity\EntityAccessControlHandler->createAccess('', Object) (Line: 60)
Drupal\commerce_shipping\Access\ShipmentCollectionAccessCheck->access(Object, Object, Object)
From stepping through the code, I don't think OG is at fault here. The problem is ShipmentCollectionAccessCheck is invoking Drupal's access with NULL as a bundle key. It appears to be related to the change in #3174306: Viewing shipments requires the "administer commerce_shipment" permission.
I have a fix for this, which is basically to not try to do access check if there is not a shipment.
Comment | File | Size | Author |
---|---|---|---|
#6 | commerce_shipping-could-not-load-shipment-type-3259808-6.patch | 1007 bytes | Rob230 |
Comments
Comment #2
Rob230 CreditAttribution: Rob230 as a volunteer and at CTI Digital for The Chartered Society of Physiotherapy commentedComment #3
Rob230 CreditAttribution: Rob230 as a volunteer and at CTI Digital for The Chartered Society of Physiotherapy commentedComment #5
Rob230 CreditAttribution: Rob230 as a volunteer and at CTI Digital for The Chartered Society of Physiotherapy commentedSometimes
$shipment_type_id
can be an empty string rather than NULL.Comment #6
Rob230 CreditAttribution: Rob230 as a volunteer and at CTI Digital for The Chartered Society of Physiotherapy commentedUgh editor ate my bracket.
Comment #7
jsacksick CreditAttribution: jsacksick at Centarro commentedCommitted!