Administration translation links point to translated links causing problems when using top level domains as language selector.

Fx. if the main Language is English on "domain.com" and a secondary language is Danish on "domain.dk" then links on then the node content translations link will point to "domain.com/node/1/edit/en" and "domain.dk/node/1/edit/dk", even if I set the admin language to fx. English. The problem is that a login session/cookie only exists on one of the domains, so one of the links will cause a permission denied error. The same issue exists on the translation overview "node/1/translate".

The patch below simple removes any localization from the translation link generation, I don't know if this is the right solution, but currently it solves my issue.

diff --git a/drupal/modules/entity_translation/entity_translation.admin.inc b/drupal/modules/entity_translation/entity_translation.admin.inc
index 9b60df6..ccef3fa 100644
--- a/drupal/modules/entity_translation/entity_translation.admin.inc
+++ b/drupal/modules/entity_translation/entity_translation.admin.inc
@@ -264,7 +264,7 @@ function entity_translation_overview($entity_type, $entity, $callback = NULL) {
if ($edit_path && $handler->getAccess('update') && $handler->getTranslationAccess($langcode)) {
$link = isset($edit_links->links[$langcode]['href']) ? $edit_links->links[$langcode] : array('href' => $edit_path, 'language' => $language);
$link['query'] = isset($_GET['destination']) ? drupal_get_destination() : FALSE;
- $options[] = l(t('edit'), $link['href'], $link);
+ $options[] = l(t('edit'), $link['href']);
}

$status = $translation['status'] ? t('Published') : t('Not published');
diff --git a/drupal/modules/entity_translation/includes/translation.handler.inc b/drupal/modules/entity_translation/includes/translation.handler.inc
index ae7ede3..c475ac7 100644
--- a/drupal/modules/entity_translation/includes/translation.handler.inc
+++ b/drupal/modules/entity_translation/includes/translation.handler.inc
@@ -1376,7 +1376,7 @@ class EntityTranslationDefaultHandler implements EntityTranslationHandlerInterfa
'href' => $link['href'],
'title' => t($languages[$langcode]->name),
'weight' => $languages[$langcode]->weight,
- 'localized_options' => $link,
+ #'localized_options' => $link,
) + $router_item;
$language_tabs[] = $tab;
}

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

StoraH’s picture

Same issue here.. Made a patch with the same code.

seanr’s picture

Status: Active » Reviewed & tested by the community

Tested on a pretty crazy complex site that would be pretty likely to cause trouble if any did, and it worked fine. :-)

plach’s picture

Status: Reviewed & tested by the community » Needs work

This is removing an existing functionality so it does not look the proper fix, sorry.