diff --git a/modules/product/src/Entity/ProductVariation.php b/modules/product/src/Entity/ProductVariation.php index bcf8ed0..301b54c 100644 --- a/modules/product/src/Entity/ProductVariation.php +++ b/modules/product/src/Entity/ProductVariation.php @@ -113,7 +113,7 @@ class ProductVariation extends CommerceContentEntityBase implements ProductVaria 'delete-form', 'collection', ]; - if (in_array($rel, $requires_product_routes) === TRUE && !$this->getProductId()) { + if (in_array($rel, $requires_product_routes) && !$this->getProductId()) { // Throw a RouteNotFoundException so that ::uriRelationships will just // filter it out, which in turn will avoid creating exceptions when trying // to delete a variation. diff --git a/modules/product/tests/src/Kernel/ProductVariationMenuLinkTest.php b/modules/product/tests/src/Kernel/ProductVariationMenuLinkTest.php index f3d257f..df1cb7a 100644 --- a/modules/product/tests/src/Kernel/ProductVariationMenuLinkTest.php +++ b/modules/product/tests/src/Kernel/ProductVariationMenuLinkTest.php @@ -2,7 +2,6 @@ namespace Drupal\Tests\commerce_product\Kernel; -use Drupal\commerce_product\Entity\ProductVariation; use Drupal\Tests\commerce\Kernel\CommerceKernelTestBase; /** @@ -20,9 +19,7 @@ class ProductVariationMenuLinkTest extends CommerceKernelTestBase { protected $variationStorage; /** - * Modules to enable. - * - * @var array + * {@inheritdoc} */ public static $modules = [ 'path', @@ -47,7 +44,7 @@ class ProductVariationMenuLinkTest extends CommerceKernelTestBase { } /** - * Test that a variation van be deleted even if it has no parent product. + * Tests that a variation can be deleted even if it has no parent product. * * @see https://www.drupal.org/project/commerce/issues/3036568 */