diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index c6561b6..feb996a 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -273,7 +273,7 @@ public function getAccessController($entity_type) { * @return mixed. * A controller instance. */ - protected function getController($entity_type, $controller_type) { + public function getController($entity_type, $controller_type) { if (!isset($this->controllers[$controller_type][$entity_type])) { $class = $this->getControllerClass($entity_type, $controller_type); if (in_array('Drupal\Core\Entity\EntityControllerInterface', class_implements($class))) { diff --git a/core/modules/translation_entity/lib/Drupal/translation_entity/Access/EntityTranslationManageAccessCheck.php b/core/modules/translation_entity/lib/Drupal/translation_entity/Access/EntityTranslationManageAccessCheck.php index c2b45b8..74d73e0 100644 --- a/core/modules/translation_entity/lib/Drupal/translation_entity/Access/EntityTranslationManageAccessCheck.php +++ b/core/modules/translation_entity/lib/Drupal/translation_entity/Access/EntityTranslationManageAccessCheck.php @@ -59,6 +59,7 @@ public function access(Route $route, Request $request) { if ($entity = $request->attributes->get('entity')) { $route_requirements = $route->getRequirements(); $operation = isset($route_requirements['_translation_entity_manage_access']) ?: NULL; + $controller = $this->entityManager->getController($entity->entityType(), $entity); // Load translation. $translations = $entity->getTranslationLanguages(); @@ -71,14 +72,14 @@ public function access(Route $route, Request $request) { return $source->langcode != $target->langcode && isset($languages[$source->langcode]) && isset($languages[$target->langcode]) && !isset($translations[$target->langcode]) - && translation_entity_access($entity, $operation); + && $controller->getTranslationAccess($entity, $operation); break; case 'update': $language = language_load($request->attributes->get('language')); return isset($languages[$language->langcode]) && $language->langcode != $entity->language()->langcode && isset($translations[$language->langcode]) - && translation_entity_access($entity, $operation); + && $controller->getTranslationAccess($entity, $operation); break; } } diff --git a/core/modules/translation_entity/lib/Drupal/translation_entity/Controller/EntityTranslationController.php b/core/modules/translation_entity/lib/Drupal/translation_entity/Controller/EntityTranslationController.php index 9dcbcd3..d666358 100644 --- a/core/modules/translation_entity/lib/Drupal/translation_entity/Controller/EntityTranslationController.php +++ b/core/modules/translation_entity/lib/Drupal/translation_entity/Controller/EntityTranslationController.php @@ -65,8 +65,7 @@ public function overview(EntityInterface $entity) { $this->moduleHandler->loadInclude('translation_entity', 'inc', 'translation_entity.pages'); $entity_type = $entity->entityType(); - $controller_class = $this->entityManager->getControllerClass($entity_type, 'translation'); - $controller = new $controller_class($entity_type, $this->entityManager->getDefinition($entity_type)); + $controller = $this->entityManager->getController($entity_type, 'translation'); $languages = language_list(); $original = $entity->language()->langcode;