diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module index cf437ad..8063dcb 100644 --- a/core/modules/content_translation/content_translation.module +++ b/core/modules/content_translation/content_translation.module @@ -109,19 +109,21 @@ function content_translation_entity_info_alter(array &$entity_info) { // is shared accross different entities. $info['controllers'] += array('translation' => 'Drupal\content_translation\ContentTranslationController'); + if (!isset($info['translation']['content_translation'])) { + $info['translation']['content_translation'] = array(); + } + if (!empty($info['links']['canonical'])) { // Provide default links for the translation paths. $info['links'] += array( 'drupal:content-translation-overview' => $info['links']['canonical'] . '/translations', ); - // @todo Remove this as soon as menu access checks rely on the controller. + // @todo Remove this as soon as menu access checks rely on the + // controller. $parts = explode('/', trim($info['links']['canonical'], '/')); $entity_position = array_search("{{$entity_type}}", $parts); if ($entity_position !== FALSE) { - if (!isset($info['translation']['content_translation'])) { - $info['translation']['content_translation'] = array(); - } $info['translation']['content_translation'] += array( 'access_callback' => 'content_translation_translate_access', 'access_arguments' => array($entity_position),