Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/Entity/Routing/CrudUiRouteProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,15 @@ protected function collectionRoute(EntityTypeInterface $entity_type) {
$route->setRequirement('_permission', 'view ' . $entity_type->id() . ' entity');
return $route;
}

/**
* {@inheritdoc}
*/
protected function addFormRoute(EntityTypeInterface $entity_type) {
if ($route = parent::addFormRoute($entity_type)) {
$route->setOption('_admin_route', TRUE);
return $route;
}
}

}
4 changes: 4 additions & 0 deletions src/Entity/Routing/RevisionHtmlRouteProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ protected function revisionHistoryRoute(EntityTypeInterface $entity_type) {
'type' => 'entity:' . $entity_type->id(),
],
]);
$route->setOption('_admin_route', TRUE);
return $route;
}

Expand All @@ -58,6 +59,7 @@ protected function revisionViewRoute(EntityTypeInterface $entity_type) {
'type' => 'entity_revision:' . $entity_type->id(),
],
]);
$route->setOption('_admin_route', TRUE);
return $route;
}

Expand All @@ -74,6 +76,7 @@ protected function revisionRevertRoute(EntityTypeInterface $entity_type) {
'type' => 'entity_revision:' . $entity_type->id(),
],
]);
$route->setOption('_admin_route', TRUE);
return $route;
}

Expand All @@ -90,6 +93,7 @@ protected function revisionDeleteRoute(EntityTypeInterface $entity_type) {
'type' => 'entity_revision:' . $entity_type->id(),
],
]);
$route->setOption('_admin_route', TRUE);
return $route;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/modules/ceb_test/src/Entity/CebTestContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* "view_builder" = "\Drupal\Core\Entity\EntityViewBuilder",
* "views_data" = "\Drupal\content_entity_base\Entity\Views\EntityBaseViewsData",
* "route_provider" = {
* "html" = "\Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",
* "html" = "\Drupal\Core\Entity\Routing\AdminHtmlRouteProvider",
* "crud" = "\Drupal\content_entity_base\Entity\Routing\CrudUiRouteProvider",
* "revision" = "\Drupal\content_entity_base\Entity\Routing\RevisionHtmlRouteProvider"
* },
Expand Down