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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bmcclure created an issue. See original summary.

bmcclure’s picture

Status: Active » Needs review
FileSize
1.73 KB

Here'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.

  • bojanz committed 5ffa1b2 on 8.x-2.x authored by bmcclure
    Issue #2841706 by bmcclure: PackageTypeInterface namespace conflict
    
bojanz’s picture

Status: Needs review » Fixed

Committed, thanks! One step closer to being functional.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.