Just add the code:

  if (module_exists('pathauto') && is_array($node->translation))
    pathauto_node_operations_update(
      array_map(
        create_function('$t','return $t->nid;'),
        $node->translation
      )
    );

at the end of 'i18nsync_node_taxonomy' function (near line 200) in i18nsync.module

CommentFileSizeAuthor
#1 i18nsync.pathauto.patch1.81 KBadrien.gibrat

Comments

adrien.gibrat’s picture

Status: Needs review » Fixed
StatusFileSize
new1.81 KB

Hello lazy people!

this is the patch (the patch also correct a little annoying warning).
info about patched module:

; $Id: i18nsync.info,v 1.1.2.3 2007/06/18 23:06:46 dww Exp $
name = Synchronization
description = Synchronizes content translations
dependencies = i18n translation
package = Multilanguage - i18n - experimental
; Information added by drupal.org packaging script on 2007-10-30
version = "5.x-2.2"
project = "i18n"
datestamp = "1193766006"

patch:

--- i18nsync.module.orig	2007-06-06 13:54:18.000000000 +0200
+++ i18nsync.module	2008-04-04 12:59:46.000000000 +0200
@@ -44,16 +44,18 @@ function i18nsync_form_alter($form_id, &
       // saved as an array. Special themeing for group titles.
       foreach (i18nsync_node_available_fields($type) as $group => $data) {
         $title = $data['#title'];
-        foreach ($data['#options'] as $field => $name) {
-          $form['workflow']['i18n']['i18nsync_nodeapi'][$field] = array(
-            '#group_title' => $title,
-            '#title' => $name,
-            '#type' => 'checkbox',
-            '#default_value' => in_array($field, $current),
-            '#theme' => 'i18nsync_workflow_checkbox',
-          );
-          $title = '';  
-        }     
+        if (is_array($data['#options'])) {
+          foreach ($data['#options'] as $field => $name) {
+            $form['workflow']['i18n']['i18nsync_nodeapi'][$field] = array(
+              '#group_title' => $title,
+              '#title' => $name,
+              '#type' => 'checkbox',
+              '#default_value' => in_array($field, $current),
+              '#theme' => 'i18nsync_workflow_checkbox',
+            );
+            $title = '';
+          }
+        } 
       }
 
       break;
@@ -229,6 +231,16 @@ function i18nsync_node_taxonomy($node, $
         " WHERE tdt.trid AND tdt.language = n.language " . // trid cannot be 0 or NULL
         " AND n.nid != %d AND tn.nid = %d AND n.trid = %d AND td.vid = %d",
          $node->nid, $node->nid, $node->trid, $vocabulary->vid);  
+
+  // Update path for translations with  pathauto
+  if (module_exists('pathauto') && is_array($node->translation)) {
+    pathauto_node_operations_update(
+      array_map(
+        create_function('$t','return $t->nid;'),
+        $node->translation
+      )
+    );
+  }
 }
 
 /**

adrien.gibrat’s picture

Status: Fixed » Needs review

OOPs, i've just realized that i've set the status to fixed... but actually it need review!!!

drewish’s picture

Status: Fixed » Needs work

you shouldn't submit two bug fixes in one patch. your bug fix is a dupe of #212494: i18nsync Experimental - A little error to fix.

jose reyero’s picture

Status: Needs work » Closed (won't fix)

Only critical bug fixes for 5.x.