Skip to content

Commit

Permalink
get entity_type_id from route
Browse files Browse the repository at this point in the history
  • Loading branch information
DiDebru committed Nov 21, 2018
1 parent b8a2599 commit c9c174d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Controller/OgAdminRoutesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,15 @@ public static function create(ContainerInterface $container) {
* List of available admin routes for the current group.
*/
public function overview(RouteMatchInterface $route_match) {
$entity_type_id = $route_match->getRouteObject()->getOption('_og_entiy_type_id');
/** @var \Drupal\Core\Entity\EntityInterface $group */
$group = $route_match->getParameter('group');
if (!is_object($group)) {
return;
}
$group = $route_match->getParameter($entity_type_id ?: 'group');

// Get list from routes.
$content = [];

$route_name = "og_admin.members";
$parameters = ['entity_type_id' => $group->getEntityTypeId(), 'group' => $group->id()];
$parameters = ['entity_type_id' => $group->getEntityTypeId() ?: $entity_type_id, 'group' => $group->id()];

// We don't use Url::fromRoute() here for the access check, as it will
// prevent us from unit testing this method.
Expand Down

0 comments on commit c9c174d

Please sign in to comment.