diff -u b/hreflang.module b/hreflang.module --- b/hreflang.module +++ b/hreflang.module @@ -23,12 +23,7 @@ $is_front_page = \Drupal::service('path.matcher')->isFrontPage(); if ($config->get('defer_to_content_translation') && $entity = hreflang_content_translation_get_entity()) { if ($addXDefault) { - $url = $is_front_page - ? Url::fromRoute('') - : $entity - ->toUrl('canonical') - ->setOption('language', $entity->getUntranslated()->language()); - + $url = $is_front_page ? Url::fromRoute('') : $entity->toUrl(); $page['#attached']['html_head_link'][] = [ [ 'rel' => 'alternate', @@ -91,7 +86,7 @@ * * @return \Drupal\Core\Entity\ContentEntityInterface|null * Get an entity from route, that will be used as a source for the hreflang - * links by the content_translation module. + * links by the content_translation module. */ function hreflang_content_translation_get_entity() { if (!\Drupal::service('module_handler')->moduleExists('content_translation')) {