Commit fd70251a authored by tonytheferg's avatar tonytheferg
Browse files

Issue #3259022: Add a destination to Vado RouteSubscriber

parent 9046024d
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ namespace Drupal\commerce_vado\Routing;

use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;
use Drupal\Core\Url;

/**
 * The route subscriber.
@@ -18,8 +17,7 @@ class RouteSubscriber extends RouteSubscriberBase {
    if ($route = $collection->get('view.commerce_vado_groups.page_1')) {
      // Upcast the %commerce_product argument to the product entity
      // so the route loads properly.
      $route->setOption('parameters', ['commerce_product' => ['type' => 'entity:commerce_product']],
      ['query' => ['destination' => Url::fromRoute('<current>')->toString()]]);
      $route->setOption('parameters', ['commerce_product' => ['type' => 'entity:commerce_product']]);
      // Show the page in the admin theme.
      $route->setOption('_admin_route', TRUE);
      // Custom access check to hide the tab if the product