Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#4 | domain_lang-fix_2108315-3.patch | 576 bytes | scottalan |
#1 | domain_path-2108315-1.patch | 546 bytes | brettbirschbach |
Comments
Comment #1
brettbirschbach CreditAttribution: brettbirschbach commentedHere's the patch.
Comment #2
brettbirschbach CreditAttribution: brettbirschbach commentedComment #3
scottalan CreditAttribution: scottalan commentedI 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 withcurl http://drupal.org/files/[patch-name].patch | git apply -
Comment #4
scottalan CreditAttribution: scottalan commentedComment #5
scottalan CreditAttribution: scottalan commentedI 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} ??
Comment #6
rsvelko CreditAttribution: rsvelko commentedtested : this patch fixes the issue in title. And the issue was really nasty before the patch.
Comment #7
rsvelko CreditAttribution: rsvelko commentedthe 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...
Comment #8
alberto56 CreditAttribution: alberto56 commentedJust changing the title to avoid confusion with #2908039: Domain paths will not appear on node edit form if there are more than 25 domains
Comment #9
joekersPatch 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?
Comment #10
joekersI ended up using patches from #2809155: Support multi language (which includes this patch) and #2033875: Add Entity Translation support.
Comment #11
agentrickardThis module could use a new maintainer, so if anyone is interested, please open an issue.
Comment #13
i-trokhanenkoCommitted patch #3
Comment #14
i-trokhanenkoThanks