diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Access/ContentTranslationManageAccessCheck.php b/core/modules/content_translation/lib/Drupal/content_translation/Access/ContentTranslationManageAccessCheck.php index 2c87894..3a53710 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Access/ContentTranslationManageAccessCheck.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Access/ContentTranslationManageAccessCheck.php @@ -46,7 +46,7 @@ public function appliesTo() { * {@inheritdoc} */ public function access(Route $route, Request $request) { - if ($entity = $request->attributes->get('_entity')) { + if ($entity = $request->attributes->get('entity')) { $route_requirements = $route->getRequirements(); $operation = $route_requirements['_access_content_translation_manage']; $entity_type = $entity->entityType(); 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 ca37e49..116e9c5 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,7 @@ public function appliesTo() { * {@inheritdoc} */ public function access(Route $route, Request $request) { - if ($entity = $request->attributes->get('_entity')) { + if ($entity = $request->attributes->get('entity')) { // Get entity base info. $entity_type = $entity->entityType(); $bundle = $entity->bundle(); diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Controller/ContentTranslationController.php b/core/modules/content_translation/lib/Drupal/content_translation/Controller/ContentTranslationController.php index f94ad33..ec229e1 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Controller/ContentTranslationController.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Controller/ContentTranslationController.php @@ -17,28 +17,28 @@ class ContentTranslationController { /** * @todo Remove content_translation_overview(). */ - public function overview(EntityInterface $_entity) { + public function overview(EntityInterface $entity) { module_load_include('pages.inc', 'content_translation'); - return content_translation_overview($_entity); + return content_translation_overview($entity); } /** * @todo Remove content_translation_add_page(). */ - public function add(EntityInterface $_entity, $source, $target) { + public function add(EntityInterface $entity, $source, $target) { module_load_include('pages.inc', 'content_translation'); $source = language_load($source); $target = language_load($target); - return content_translation_add_page($_entity, $source, $target); + return content_translation_add_page($entity, $source, $target); } /** * @todo Remove content_translation_edit_page(). */ - public function edit(EntityInterface $_entity, $language) { + public function edit(EntityInterface $entity, $language) { module_load_include('pages.inc', 'content_translation'); $language = language_load($language); - return content_translation_edit_page($_entity, $language); + return content_translation_edit_page($entity, $language); } } diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Form/ContentTranslationForm.php b/core/modules/content_translation/lib/Drupal/content_translation/Form/ContentTranslationForm.php index e4d7fe9..7142a49 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Form/ContentTranslationForm.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Form/ContentTranslationForm.php @@ -19,10 +19,10 @@ class ContentTranslationForm { * * @todo Remove content_translation_delete_confirm(). */ - public function deleteTranslation(EntityInterface $_entity, $language) { + public function deleteTranslation(EntityInterface $entity, $language) { module_load_include('pages.inc', 'content_translation'); $language = language_load($language); - return drupal_get_form('content_translation_delete_confirm', $_entity, $language); + return drupal_get_form('content_translation_delete_confirm', $entity, $language); } } diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Plugin/ContentTranslationLocalTasks.php b/core/modules/content_translation/lib/Drupal/content_translation/Plugin/ContentTranslationLocalTasks.php index 32bdb57..50c4c60 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Plugin/ContentTranslationLocalTasks.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Plugin/ContentTranslationLocalTasks.php @@ -22,16 +22,16 @@ public function getRouteParameters(Request $request) { $parameters = parent::getRouteParameters($request); $entity_type = $this->pluginDefinition['entity_type']; if ($raw_variables = $request->attributes->get('_raw_variables')) { - // When the entity type is in the path, populate '_entity' for any dynamic + // When the entity type is in the path, populate 'entity' for any dynamic // local tasks. if ($raw_variables->has($entity_type)) { $entity = $raw_variables->get($entity_type); - $parameters['_entity'] = $entity; + $parameters['entity'] = $entity; } - // When '_entity' is in the path, populate the parameters with the value + // When 'entity' is in the path, populate the parameters with the value // for the actual entity type. - elseif ($raw_variables->has('_entity')) { - $entity = $raw_variables->get('_entity'); + elseif ($raw_variables->has('entity')) { + $entity = $raw_variables->get('entity'); $parameters[$entity_type] = $entity; } } 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 fb66a24..5d30c4c 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 @@ -50,7 +50,7 @@ public function routes(RouteBuildEvent $event) { $collection = $event->getRouteCollection(); foreach ($this->entityManager->getDefinitions() as $entity_type => $entity_info) { if ($entity_info['translatable'] && isset($entity_info['translation'])) { - $path = '/' . str_replace($entity_info['menu_path_wildcard'], '{_entity}', $entity_info['menu_base_path']) . '/translations'; + $path = '/' . str_replace($entity_info['menu_path_wildcard'], '{entity}', $entity_info['menu_base_path']) . '/translations'; $route = new Route( $path, array( @@ -64,7 +64,7 @@ public function routes(RouteBuildEvent $event) { ), array( 'parameters' => array( - '_entity' => array( + 'entity' => array( 'type' => 'entity:' . $entity_type, ), ), @@ -87,7 +87,7 @@ public function routes(RouteBuildEvent $event) { ), array( 'parameters' => array( - '_entity' => array( + 'entity' => array( 'type' => 'entity:' . $entity_type, ), ), @@ -108,7 +108,7 @@ public function routes(RouteBuildEvent $event) { ), array( 'parameters' => array( - '_entity' => array( + 'entity' => array( 'type' => 'entity:' . $entity_type, ), ), @@ -129,7 +129,7 @@ public function routes(RouteBuildEvent $event) { ), array( 'parameters' => array( - '_entity' => array( + 'entity' => array( 'type' => 'entity:' . $entity_type, ), ), 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 09e604b..053163b 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 @@ -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(EntityInterface $entity) { + return entity_test_edit($entity); } } 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 0834cc1..8834b4a 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,11 +42,11 @@ public function routes(RouteBuildEvent $event) { $collection->add("entity_test.add_$entity_type", $route); $route = new Route( - "$entity_type/manage/{_entity}", + "$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' => array('type' => 'entity:' . $entity_type), )) ); $collection->add("entity_test.edit_$entity_type", $route);