Here is a small patch to make possible mass node cloning. Works through direct saving nodes to DB (not prepopulate surely). Maybe batch processing is needed (can be easily adopted from core node module) but i've cloned hundred of CCK nodes without timeouts...

--- clone.module.orig   2010-09-21 00:47:02.000000000 +0400
+++ clone.module        2010-09-21 14:13:38.000000000 +0400
@@ -50,6 +50,26 @@
   return $items;
 }

+/**
+ * Implementation of hook_node_operations().
+ */
+function clone_node_operations() {
+  return array(
+    'clone' => array(
+      'label' => t('Clone'),
+      'callback' => 'clone_node_operation'
+    )
+  );
+}
+
+function clone_node_operation($nodes) {
+  include_once('clone.pages.inc');
+  foreach ($nodes as $nid) {
+    clone_node_save($nid);
+  }
+  drupal_set_message(t('The update has been performed.'));
+}
+
 function clone_access_cloning($node) {
   global $user;
   // Check basic permissions first.

Comments

gorillaz.f’s picture

great!! I need it very much , let me take a test. thank you~

ordually’s picture

Thanks for the patch! It's working great for me.

_vid’s picture

+1
Sounds great. I'd like to see this included in VBO.

rolland.huie’s picture

I'm learning about VBO and cloning. I was trying to use this patch, but I don't understand how to see or use it in VBO. Should I be seeing something in the list of actions under VBO? Would anyone have time to point me to documentation on how to implement/use mass node cloning and VBO?

I've watched the tutorials at NodeOne, but unclear on how to reapply toward node cloning.

wizonesolutions’s picture

Version: 6.x-1.2 » 6.x-1.x-dev

Looks like VBO doesn't want to implement this on their side (#442240: Option to clone object?). If someone integrates Node Clone with Rules, though (or even as a core action), it seems like VBO will pick it up automatically.

An issue for rules integration was started: #450000: Rules Integration (action) with Node Clone but was closed due to lack of patches. It could be reopened if a patch was written.

kenorb’s picture