diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Access/ContentTranslationOverviewAccess.php b/core/modules/content_translation/lib/Drupal/content_translation/Access/ContentTranslationOverviewAccess.php index 116e9c5..f9dcc1d 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Access/ContentTranslationOverviewAccess.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Access/ContentTranslationOverviewAccess.php @@ -45,7 +45,8 @@ public function appliesTo() { * {@inheritdoc} */ public function access(Route $route, Request $request) { - if ($entity = $request->attributes->get('entity')) { + $entity_type = $request->attributes->get('entity_type'); + if ($entity = $request->attributes->get($entity_type)) { // Get entity base info. $entity_type = $entity->entityType(); $bundle = $entity->bundle(); diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Plugin/Derivative/ContentTranslationLocalTasks.php b/core/modules/content_translation/lib/Drupal/content_translation/Plugin/Derivative/ContentTranslationLocalTasks.php index 77ba42a..aa96452 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Plugin/Derivative/ContentTranslationLocalTasks.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Plugin/Derivative/ContentTranslationLocalTasks.php @@ -14,7 +14,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * @todo. + * Provides dynamic local tasks for content translation. */ class ContentTranslationLocalTasks extends DerivativeBase implements ContainerDerivativeInterface { diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Routing/ContentTranslationRouteSubscriber.php b/core/modules/content_translation/lib/Drupal/content_translation/Routing/ContentTranslationRouteSubscriber.php index dbcbbcf..e3271df 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Routing/ContentTranslationRouteSubscriber.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Routing/ContentTranslationRouteSubscriber.php @@ -62,13 +62,6 @@ public function routes(RouteBuildEvent $event) { array( '_access_content_translation_overview' => $entity_type, '_permission' => 'translate any entity', - ), - array( - 'parameters' => array( - 'entity' => array( - 'type' => 'entity:' . $entity_type, - ), - ), ) ); $collection->add("content_translation.translation_overview_$entity_type", $route); @@ -85,13 +78,6 @@ public function routes(RouteBuildEvent $event) { array( '_permission' => 'translate any entity', '_access_content_translation_manage' => 'create', - ), - array( - 'parameters' => array( - 'entity' => array( - 'type' => 'entity:' . $entity_type, - ), - ), ) ); $collection->add("content_translation.translation_add_$entity_type", $route); @@ -107,13 +93,6 @@ public function routes(RouteBuildEvent $event) { array( '_permission' => 'translate any entity', '_access_content_translation_manage' => 'update', - ), - array( - 'parameters' => array( - 'entity' => array( - 'type' => 'entity:' . $entity_type, - ), - ), ) ); $collection->add("content_translation.translation_edit_$entity_type", $route); @@ -129,13 +108,6 @@ public function routes(RouteBuildEvent $event) { array( '_permission' => 'translate any entity', '_access_content_translation_manage' => 'delete', - ), - array( - 'parameters' => array( - 'entity' => array( - 'type' => 'entity:' . $entity_type, - ), - ), ) ); $collection->add("content_translation.delete_$entity_type", $route); diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Controller/EntityTestController.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Controller/EntityTestController.php index 27c42d7..03d7dc0 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Controller/EntityTestController.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Controller/EntityTestController.php @@ -7,10 +7,10 @@ namespace Drupal\entity_test\Controller; -use Drupal\Core\Entity\EntityInterface; +use Symfony\Component\HttpFoundation\Request; /** - * @todo. + * Controller routines for entity_test routes. */ class EntityTestController { @@ -24,8 +24,8 @@ public function testAdd($entity_type) { /** * @todo Remove entity_test_edit() */ - public function testEdit(EntityInterface $entity) { - return entity_test_edit($entity); + public function testEdit(Request $request, $entity_type) { + return entity_test_edit($request->attributes->get($entity_type)); } } diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Routing/RouteSubscriber.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Routing/RouteSubscriber.php index 8834b4a..3a8c734 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Routing/RouteSubscriber.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Routing/RouteSubscriber.php @@ -42,12 +42,9 @@ public function routes(RouteBuildEvent $event) { $collection->add("entity_test.add_$entity_type", $route); $route = new Route( - "$entity_type/manage/{entity}", - array('_content' => '\Drupal\entity_test\Controller\EntityTestController::testEdit'), - array('_permission' => 'administer entity_test content'), - array('parameters' => array( - 'entity' => array('type' => 'entity:' . $entity_type), - )) + "$entity_type/manage/{" . $entity_type . '}', + array('_content' => '\Drupal\entity_test\Controller\EntityTestController::testEdit', 'entity_type' => $entity_type), + array('_permission' => 'administer entity_test content') ); $collection->add("entity_test.edit_$entity_type", $route); } diff --git a/core/modules/system/tests/modules/module_test/lib/Drupal/module_test/Controller/ModuleTestController.php b/core/modules/system/tests/modules/module_test/lib/Drupal/module_test/Controller/ModuleTestController.php index 57357ed..df3b8f7 100644 --- a/core/modules/system/tests/modules/module_test/lib/Drupal/module_test/Controller/ModuleTestController.php +++ b/core/modules/system/tests/modules/module_test/lib/Drupal/module_test/Controller/ModuleTestController.php @@ -8,7 +8,7 @@ namespace Drupal\module_test\Controller; /** - * @todo. + * Controller routines for module_test routes. */ class ModuleTestController { diff --git a/core/modules/system/tests/modules/system_test/lib/Drupal/system_test/Controller/SystemTestController.php b/core/modules/system/tests/modules/system_test/lib/Drupal/system_test/Controller/SystemTestController.php index 3aad7344..db4302f 100644 --- a/core/modules/system/tests/modules/system_test/lib/Drupal/system_test/Controller/SystemTestController.php +++ b/core/modules/system/tests/modules/system_test/lib/Drupal/system_test/Controller/SystemTestController.php @@ -10,7 +10,7 @@ use Drupal\Core\Controller\ControllerBase; /** - * @todo. + * Controller routines for system_test routes. */ class SystemTestController extends ControllerBase {