*** image_fupload.orig/image_fupload_imagefield/image_fupload_imagefield.module	2009-04-08 22:44:42.000000000 +1000
--- image_fupload/image_fupload_imagefield/image_fupload_imagefield.module	2010-04-25 10:59:55.000000000 +1000
***************
*** 274,282 ****
      }
      
      // if we are editing already existing node, remove nid to prevent errors because node was changed before
      if (isset($form['nid']['#value'])) {
        $form['gallery_nid']['#value'] = $form['nid']['#value'];
-       unset($form['nid']['#value'], $form_state['values']['nid']);
      }
      
      // Form validation
--- 274,284 ----
      }
  
      // if we are editing already existing node, remove nid to prevent errors because node was changed before
+     // .. or not. This causes issues with the path module once a node has one set.
+     // We need to keep the gallery_nid since that's used elsewhere, but leave the original value alone.
+     // To prevent "someone else edited this node" errors, the $node->changed time is updated futher on
      if (isset($form['nid']['#value'])) {
        $form['gallery_nid']['#value'] = $form['nid']['#value'];
      }
      
      // Form validation
***************
*** 311,316 ****
--- 313,322 ----
              $insert = empty($node->nid);
              // add new files to node
              $node->$field_name = array(0 => $file);
+ 
+             // Update $node->changed to avoid errors
+             $node->changed = node_last_changed($node->nid);
+ 
              // save node
              node_save($node);
            
