? cck-1.patch
? cck-2.patch
? cloneimagefield-200092-19.patch
? node.txt
? remove-file-image-200092-5x-1x-18.patch
? remove-file-image-200092-5x-1x-21.patch
? remove-file-image-200092-5x-2x-17.patch
Index: README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_clone/README.txt,v
retrieving revision 1.5.4.2
diff -u -p -r1.5.4.2 README.txt
--- README.txt	3 May 2008 23:57:54 -0000	1.5.4.2
+++ README.txt	23 May 2008 00:35:22 -0000
@@ -1,12 +1,14 @@
-REDAME file for the clone module for Drupal 5.x.
+README file for the clone module for Drupal 5.x.
 
 The clone module allows users to make a copy of an existing node and then edit
 that copy. The authorship is set to the current user, the menu and url aliases
 are reset, and the (localized) words "Clone of" are inserted into the title to
 remind you that you are not editing the original node.
 
-Users with the "clone node" permission can utilize this functionality. A new
-tab will appear on node pages with the word "clone".  Once you click this
+Users with the "clone node" permission can utilize this functionality for any
+node, while user with "clone own nodes" permission can only clone content that
+they are the author of (see below regarding other permission checks). A new
+tab will appear on node pages with the word "Clone".  Once you click this
 tab you have *already* created a new node that is a copy of the node you were
 viewing, and you will be redirected to an edit screen for that new node.
 
@@ -19,20 +21,24 @@ set whether an additional confirmation s
 of a node, and also set whether the publishing options are reset when making
 a clone of a node.  This is set for each node type individually.
 
-This module seems to work with common node types, however YMMV. File
-attachments are not included in the cloned node.  It seems to produce
-functional clones of forms made using the webform module, but because of
-replication of some of the webforms IDs, the form's theming will always be
-the same as the original webform. In all cases, but especially
-if you are using a complex or custom node type, you should evaluate this
-module on a test site with a copy of your database before attempting to use
-it on a live site. On the settings page you may choose node types to be omitted 
-from the cloning mechanism - no users will be able to try to clone a node of 
-an omitted type.
+This module seems to work with common node types, however YMMV. File attachments
+are not included in the cloned node. For the core Upload module and for the CCK
+Imagefield and Filefield modules, the node is proceesed to make sure data about
+attachements on the original node is removed. Otherwise, data corruption would
+occur. For other modules that add attachements, you may have problems. This 
+module seems to produce functional clones of forms made using the webform 
+module, but because of replication of some of the webforms IDs, the form's 
+theming will always be the same as the original webform. 
+
+In all cases, but especially if you are using a complex or custom node type, you 
+should evaluate this module on a test site with a copy of your database before
+attempting to use it on a live site. On the settings page you may choose node
+types to be omitted from the cloning mechanism - no users will be able to try to
+clone a node of an omitted type. 
 
 To install this module, copy the folder with the all the files to the
 /sites/all/modules  OR sites/defualt/modules directory of your Drupal 
-installation and enable it at /admin/build/modules.  A new permission is 
+installation and enable it at /admin/build/modules.  Two new permissions are 
 available, but there are no changes to the database structure.
 
 Note: this module originally derived from code posted by Steve Ringwood
Index: clone.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_clone/clone.module,v
retrieving revision 1.9.4.9
diff -u -p -r1.9.4.9 clone.module
--- clone.module	4 May 2008 00:48:04 -0000	1.9.4.9
+++ clone.module	23 May 2008 00:35:22 -0000
@@ -193,6 +193,22 @@ function clone_node($nid) {
       $node->created = 0;
       $node->menu = NULL;
       $node->path = NULL;
+      $node->files = array();
+      // Remove CCK file and image attachements
+      if (module_exists('imagefield') || module_exists('filefield')) {
+        $content_type = module_invoke('content', 'types', $node->type);
+        // Find all the fields that are files or images.
+        foreach ($content_type['fields'] as $data) {
+          if (($data['type'] == 'file') || ($data['type'] == 'image')) {
+            $key = $data['field_name'];
+            // Remove any attached files as with $node->files
+            if (isset($node->$key)) {
+              $node->$key = array(); 
+            }
+          }
+        }
+      }
+      // Add indicator text to the title
       $node->title = t('Clone of !title', array('!title' => $node->title));
 
       if (variable_get('clone_reset_'. $node->type, FALSE)) {
