Index: inline.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/inline/inline.module,v retrieving revision 1.38 diff -u -p -r1.38 inline.module --- inline.module 11 Aug 2009 20:25:33 -0000 1.38 +++ inline.module 11 Aug 2009 20:27:59 -0000 @@ -268,12 +268,13 @@ function inline_alter_macros(&$node, $fi return; } - // Backup some node properties to undo them later, since we don't know whether - // other modules are invoked after hook_nodeapi of Inline. + // Backup some node properties to revert them later, since we do not know + // whether other modules are invoked after inline_nodeapi(). $properties = array( 'is_new' => $node->is_new, 'revision' => $node->revision, 'old_vid' => isset($node->old_vid) ? $node->old_vid : NULL, + 'files' => $node->files, ); // @todo When a new node is saved, some modules (like menu) do not update @@ -283,6 +284,17 @@ function inline_alter_macros(&$node, $fi // ensure this. $node = node_load($node->nid); + // Revert some file properties from the originally passed node. + foreach ($node->files as $fid => $file) { + // $op insert/update expects an array. + settype($node->files[$fid], 'array'); + // Do not perform any file updates. + if (isset($properties['files'][$fid])) { + $node->files[$fid]['remove'] = 0; + $node->files[$fid]['new'] = FALSE; + } + } + // Mark this node as processed to prevent recursive loops. $node->inline_altered = TRUE; @@ -299,7 +311,7 @@ function inline_alter_macros(&$node, $fi // Save the altered node (again). node_save($node); - // Undo our changes. + // Revert our changes. foreach ($properties as $property => $value) { $node->$property = $value; } @@ -391,8 +403,6 @@ function inline_nodeapi(&$node, $op, $a3 // filter cache for all contents referencing it. As long as there is // no generic solution, we completely clear the filter cache. cache_clear_all(NULL, 'cache_filter'); - return; - // Break intentionally left out. case 'insert': // Update references to 'current' system objects, e.g. the nid after