Closed (duplicate)
Project:
Node clone
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Sep 2010 at 10:29 UTC
Updated:
11 Sep 2013 at 11:17 UTC
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
Comment #1
gorillaz.f commentedgreat!! I need it very much , let me take a test. thank you~
Comment #2
ordually commentedThanks for the patch! It's working great for me.
Comment #3
_vid commented+1
Sounds great. I'd like to see this included in VBO.
Comment #4
rolland.huie commentedI'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.
Comment #5
wizonesolutionsLooks 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.
Comment #6
kenorb commented#1316284: Views Bulk Operations integration with Node Clone