Skip to content

Commit 9131c8f

Browse files
finnefbojanz
authored andcommitted
issue #2859570 Create a generic entity bundle delete form (#688)
1 parent 4ba1fad commit 9131c8f

File tree

15 files changed

+53
-164
lines changed

15 files changed

+53
-164
lines changed

modules/order/src/Entity/OrderItemType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* "form" = {
2222
* "add" = "Drupal\commerce_order\Form\OrderItemTypeForm",
2323
* "edit" = "Drupal\commerce_order\Form\OrderItemTypeForm",
24-
* "delete" = "Drupal\commerce_order\Form\OrderItemTypeDeleteForm"
24+
* "delete" = "Drupal\commerce\Form\CommerceBundleEntityDeleteFormBase"
2525
* },
2626
* "route_provider" = {
2727
* "default" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",

modules/order/src/Entity/OrderType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* "form" = {
2222
* "add" = "Drupal\commerce_order\Form\OrderTypeForm",
2323
* "edit" = "Drupal\commerce_order\Form\OrderTypeForm",
24-
* "delete" = "Drupal\commerce_order\Form\OrderTypeDeleteForm"
24+
* "delete" = "Drupal\commerce\Form\CommerceBundleEntityDeleteFormBase"
2525
* },
2626
* "route_provider" = {
2727
* "default" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",

modules/order/src/Form/OrderItemTypeDeleteForm.php

Lines changed: 0 additions & 31 deletions
This file was deleted.

modules/order/src/Form/OrderTypeDeleteForm.php

Lines changed: 0 additions & 31 deletions
This file was deleted.

modules/order/tests/src/Functional/OrderTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function testDeleteOrderType() {
8989

9090
// Try to delete the order type.
9191
$this->drupalGet('admin/commerce/config/order-types/' . $type->id() . '/delete');
92-
$this->assertSession()->pageTextContains(t('@type is used by 1 order on your site. You can not remove this order type until you have removed all of the @type orders.', ['@type' => $type->label()]));
92+
$this->assertSession()->pageTextContains(t('@type is used by 1 order on your site. You cannot remove this order type until you have removed all of the @type orders.', ['@type' => $type->label()]));
9393
$this->assertSession()->pageTextNotContains(t('This action cannot be undone.'));
9494

9595
// Deleting the order type when its not being referenced by an order.

modules/product/src/Entity/ProductType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* "form" = {
2323
* "add" = "Drupal\commerce_product\Form\ProductTypeForm",
2424
* "edit" = "Drupal\commerce_product\Form\ProductTypeForm",
25-
* "delete" = "Drupal\commerce_product\Form\ProductTypeDeleteForm"
25+
* "delete" = "Drupal\commerce\Form\CommerceBundleEntityDeleteFormBase"
2626
* },
2727
* "route_provider" = {
2828
* "default" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",

modules/product/src/Entity/ProductVariationType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* "form" = {
2323
* "add" = "Drupal\commerce_product\Form\ProductVariationTypeForm",
2424
* "edit" = "Drupal\commerce_product\Form\ProductVariationTypeForm",
25-
* "delete" = "Drupal\commerce_product\Form\ProductVariationTypeDeleteForm"
25+
* "delete" = "Drupal\commerce\Form\CommerceBundleEntityDeleteFormBase"
2626
* },
2727
* "route_provider" = {
2828
* "default" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",

modules/product/src/Form/ProductTypeDeleteForm.php

Lines changed: 0 additions & 31 deletions
This file was deleted.

modules/product/src/Form/ProductVariationTypeDeleteForm.php

Lines changed: 0 additions & 31 deletions
This file was deleted.

modules/product/tests/src/Functional/ProductTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function testProductTypeDeletion() {
100100
// a product of that type. Right now the check is done on the form level.
101101
$this->drupalGet('admin/commerce/config/product-types/' . $product_type->id() . '/delete');
102102
$this->assertSession()->pageTextContains(
103-
t('@type is used by 1 product on your site. You can not remove this product type until you have removed all of the @type products.', ['@type' => $product_type->label()]),
103+
t('@type is used by 1 product on your site. You cannot remove this product type until you have removed all of the @type products.', ['@type' => $product_type->label()]),
104104
'The product type will not be deleted until all products of that type are deleted.'
105105
);
106106
$this->assertSession()->pageTextNotContains(t('This action cannot be undone.'));

0 commit comments

Comments
 (0)