Commit 13e93a9e authored by alexpott's avatar alexpott

Issue #2551429 by Wim Leers, stefan.r, jibran, larowlan: FieldUI should...

Issue #2551429 by Wim Leers, stefan.r, jibran, larowlan: FieldUI should accommodate route options in RouteSubscriber
parent de605f8d
......@@ -47,7 +47,7 @@ protected function alterRoutes(RouteCollection $collection) {
}
$path = $entity_route->getPath();
$options = array();
$options = $entity_route->getOptions();
if ($bundle_entity_type = $entity_type->getBundleEntityType()) {
$options['parameters'][$bundle_entity_type] = array(
'type' => 'entity:' . $bundle_entity_type,
......
......@@ -112,4 +112,13 @@ public function assertLocalTasks() {
$this->assertLink('Manage form display');
}
/**
* Asserts that admin routes are correctly marked as such.
*/
public function testAdminRoute() {
$route = \Drupal::service('router.route_provider')->getRouteByName('entity.entity_test.field_ui_fields');
$is_admin = \Drupal::service('router.admin_context')->isAdminRoute($route);
$this->assertTrue($is_admin, 'Admin route correctly marked for "Manage fields" page.');
}
}
......@@ -60,7 +60,8 @@ public function routes() {
$routes["entity.$entity_type_id.admin_form"] = new Route(
"$entity_type_id/structure/{bundle}",
array('_controller' => '\Drupal\entity_test\Controller\EntityTestController::testAdmin'),
array('_permission' => 'administer entity_test content')
array('_permission' => 'administer entity_test content'),
array('_admin_route' => TRUE)
);
}
return $routes;
......
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