When editing a node that does not match the language of the current user, the domain paths are not correctly loaded. If the user saves the node in this state, all domain paths for that node are lost.

i.e.
User is accessing site in English
User is editing a Spanish node - Domain paths for this node therefore pertain to Spanish

Patch incoming shortly.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

brettbirschbach’s picture

FileSize
546 bytes

Here's the patch.

brettbirschbach’s picture

Status: Active » Needs review
scottalan’s picture

I wasn't able to get this patch to apply without running patch -p1 < [patch]. I need this to apply with git apply so I re-rolled the same exact patch but will apply with git apply during a drush make or with curl http://drupal.org/files/[patch-name].patch | git apply -

scottalan’s picture

Issue summary: View changes
FileSize
576 bytes
scottalan’s picture

I need to review this further as I'm not sure this is fixing the problem I'm having. I am unable to see the domain paths, however the patch does not bring them back. I will debug when I get a chance and hopefully come up with a fix. Each of the path fields/labels are set to {display: none} ??

rsvelko’s picture

Status: Needs review » Reviewed & tested by the community

tested : this patch fixes the issue in title. And the issue was really nasty before the patch.

rsvelko’s picture

the patch is:

diff --git a/domain_path.module b/domain_path.module
--- a/domain_path.module
+++ b/domain_path.module
@@ -310,7 +310,8 @@ function domain_path_form_node_form_alter(&$form, $form_state) {
foreach ($domains as $domain_id => $domain) {
$path = FALSE;
if ($nid) {
- $path = domain_path_lookup_path('alias', 'node/' . $nid, $domain_id);
+ $lang = empty($form['#node']->language) ? NULL : $form['#node']->language;
+ $path = domain_path_lookup_path('alias', 'node/' . $nid, $domain_id, $lang);
}

$default = '';

I checked the domain_path_lookup_path - function - whether it expects LANGUAGE_NONE or NULL when no-language is set in a non-multilang site.
Patch is ok cause exactly NULL is expected in this case.

So the line
+ $lang = empty($form['#node']->language) ? NULL : $form['#node']->language;

is correctly setting lang to null and NOT to LANGUAGE_NONE when empty...

alberto56’s picture

Title: Domain paths not showing on node edit form » Domain paths not showing on node edit form in case of a language mismatch
joekers’s picture

Patch works for me in that I don't lose my existing aliases when saving a translation, however I can't save an alias for a translation - not sure if that's just not supported by the module or actually an issue?

joekers’s picture

I ended up using patches from #2809155: Support multi language (which includes this patch) and #2033875: Add Entity Translation support.

agentrickard’s picture

This module could use a new maintainer, so if anyone is interested, please open an issue.

i-trokhanenko’s picture

Committed patch #3

i-trokhanenko’s picture

Assigned: brettbirschbach » Unassigned
Status: Reviewed & tested by the community » Fixed

Thanks

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.