Commit 1292c5e4 authored by bojanz's avatar bojanz

Issue #2826693: Content translation breaks the promotion forms

parent 13ef5f66
......@@ -37,7 +37,7 @@ use Drupal\Core\Plugin\Context\ContextDefinition;
* "delete" = "Drupal\Core\Entity\ContentEntityDeleteForm"
* },
* "route_provider" = {
* "default" = "Drupal\Core\Entity\Routing\AdminHtmlRouteProvider",
* "default" = "Drupal\commerce_promotion\PromotionRouteProvider",
* "delete-multiple" = "Drupal\entity\Routing\DeleteMultipleRouteProvider",
* },
* "translation" = "Drupal\content_translation\ContentTranslationHandler"
......@@ -56,6 +56,7 @@ use Drupal\Core\Plugin\Context\ContextDefinition;
* },
* links = {
* "add-form" = "/promotion/add",
* "canonical" = "/promotion/{commerce_promotion}/edit",
* "edit-form" = "/promotion/{commerce_promotion}/edit",
* "delete-form" = "/promotion/{commerce_promotion}/delete",
* "delete-multiple-form" = "/admin/commerce/promotions/delete",
......
<?php
namespace Drupal\commerce_promotion;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Entity\Routing\AdminHtmlRouteProvider;
/**
* Provides routes for the Promotion entity.
*/
class PromotionRouteProvider extends AdminHtmlRouteProvider {
/**
* {@inheritdoc}
*/
protected function getCanonicalRoute(EntityTypeInterface $entity_type) {
// Promotions use the edit-form route as the canonical route.
// @todo Remove this when #2479377 gets fixed.
return $this->getEditFormRoute($entity_type);
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment