Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently Shipment and ShipmentInterface both declare the following:
use Drupal\commerce_shipping\Plugin\Commerce\PackageType\PackageTypeInterface;
However, there is also a PackageTypeInterface class in the same namespace as Shipment and ShipmentInterface, so this causes a fatal error:
PHP Fatal error: Cannot use Drupal\commerce_shipping\Plugin\Commerce\PackageType\PackageTypeInterface as PackageTypeInterface because the name is already in use in /code/modules/commerce_shipping/src/Entity/Shipment.php on line 5
Comment | File | Size | Author |
---|---|---|---|
#2 | commerce_shipping-Fix_namespace_conflict-2841706-2.patch | 1.73 KB | bmcclure |
Comments
Comment #2
bmcclure CreditAttribution: bmcclure as a volunteer and at Top Floor commentedHere's a simple patch that just changes how shipments refer to PackageTypeInterface plugins vs PackageTypeInterface entities. Not sure if it's the best solution, but it resolves the error.
Comment #4
bojanz CreditAttribution: bojanz at Centarro for Adapt commentedCommitted, thanks! One step closer to being functional.