Hi there,

I am currently using this module in combination with Entity Translation and Domain Locale. This means the $node->language is set to the language provided by language negotiation (in my case, a prefix) settings. The Domain Locale module provides a way to associate one or more languages to a domain and also set a different default language per domain.

A problem arises when creating content for a specific language while on an URL associated with another language. So for instance, when creating a node with English content while accessing the site through an URL associated with the Dutch language, the $node->language will be set to 'NL'. The $node->language is then used to create records in the domain_path table.

The problem also turns up when you associate multiple domains to a single node. The domain path languages will all be set to the $node->language.

When accessing the node with English content domain_path will search for an alias with language 'EN', resulting in no records found. Thus we get a page not found.

Domain Locale throws in a little more complexity but in fact only sets the global $language to the default language associated with a domain.

I would love to spend some time on this but want to check with maintainers first if this is actually a bug and perhaps could already be fixed using a specific configuration.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ericmulder1980 created an issue. See original summary.

ericmulder1980’s picture

I think i have managed to implement support for the domain_locale with the code below.

...
...
...
foreach ($node->domain_path as $domain_id => $alias) {

      // NEW CODE

      // Add support for the domain_locale module.
      if (module_exists('domain_locale')) {
        $domain_locale = domain_conf_variable_get($domain_id, 'language_default');
        $language = !empty($domain_locale) ? $domain_locale : $language;
      }

      // NEW CODE

      // Attempt to retreive the path.
      $conditions = array(
        'source' => "node/$node->nid",
        'language' => $language,
        'domain_id' => $domain_id,
      );
      $path = domain_path_path_load($conditions);
...
...
...

Could someone please review this?

ericmulder1980’s picture

ericmulder1980’s picture

Status: Active » Needs review
othermachines’s picture

Is it possible that this issue is related to #2033875: Add Entity Translation support?