It would be kind of neat to have node clone available as action so you automatically get integration into VBO etc.
Any oppinions about it? If there are no negatives i would like to implement it.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RobLoach’s picture

Title: Provide a node clone action » Views Bulk Operations integration with Node Clone
Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Active » Postponed (maintainer needs more info)

Not sure how useful cloning 10 different nodes at the same time would be. Is this what you were asking?

dawehner’s picture

Yes, this is the concrete use case here. I have to apologise but it's a client idea :)

dawehner’s picture

This page has some sort of connected nodes which has similar information but for different area's of the page.
Update status to see whether it is considered for node clone or not. Alternative i will just go ahead and write a custom action :)

sharp6621’s picture

I have a use case that would benefit from bulk cloning nodes tagged by semester to roll forward for editing for the next semester. I'd also run a bulk edit to change the tag from one semester to another.

texas_tater’s picture

Version: 7.x-1.x-dev » 6.x-1.3

Hey peeps! I've been looking for this since beginning my work with Drupal. Our use case is almost identical to sharp6621's description. In our case, we are creating and maintaining University catalog content, which means last year's "published" pages become the next year's beginning "draft". We keep these completely separate so we can output a "book" to PDF, web, etc. Each one needs to be kept separately. Right now, we have to manually clone each and every node, and then manually change the "edition" metadata, since nodeclone already dumps us into Edit mode. This limitation has caused me to hesitate to move into other areas w/ drupal here at the university, so this kind of integration would be very welcome! Thanks :)

goodeit’s picture

I also have a client use case that involves bulk cloning of nodes. Specifically, I'd like to be able to clone all nodes of a certain taxonomy term and assign them a new taxonomy term. I think having an action available in VBO would be a great start to this!

xaa’s picture

hi, that will be definitely a nice feature, subscribing ! :)

We are using drupal as a slides generator for presentation during conference.(a slide = a node).
So, Drupal generates xml that's used in a flash animation.

The speaker can create slides (nodes) with a tree structure based on taxonomy.
As they make a lot of conferences/presentation with 80% of the content is the same as the previous presentation, the bulk clone function will be a real benefit for the workflow.

Until now, they can clone node by node. That's working but not really optimal.

(In any case, thanks for this module !)

thedavidmeister’s picture

Status: Postponed (maintainer needs more info) » Active

I can think of multiple use cases that would make this really useful. Rules integration would also be a nice side-effect of cloning-exposed-as-an-action.

kscheirer’s picture

Status: Active » Needs review
FileSize
532 bytes

This should do the trick.

I have a use case for it too - I'm converting a single content type into 2. Node_convert handles the actual conversion, but I'd like to clone a bunch of the nodes first, so I can convert twice.

kscheirer’s picture

Sorry, forgot to deal with the nids as array, which is how node_operations sends them. Also needed to include clone.pages.inc manually. Tested and working for me.

Sinan Erdem’s picture

Is #10 a patch for D6 or D7 ?

kscheirer’s picture

D6, sorry should have been clearer about that. My client is still on that codebase, but if there's interest I'll look at a D7 patch as well. Looking at hook_node_operations(), the patches might be almost the same anyway.

cphilli12’s picture

Version: 6.x-1.3 » 7.x-1.x-dev

I would love to use the D7 patch, I think it would be similar, can you help identify what would change, I would like this functionality.

BrightBold’s picture

Also looking for this feature for D7. Basically the same use case as #4 & #5 — I want an easy way to set up all the events for a school year by copying last year's set. Then all the content editor would have to do would be to go through and change the dates.

kscheirer’s picture

The patch in #10 seems to work fine in D7 as well. The hook is identical, and the functions being called haven't changed. Can someone test it out?

ezeedub’s picture

From VBO for Drupal 7 docs

Note that VBO no longer supports hook_node_operations() and hook_user_operations()
which were supported in in the Drupal 6 branch.

TravisJohnston’s picture

+1 Subscribing

I am in dire need of this functionality. I have a project management tool built into D6 and there are times where projects could share similar tasks. For instance my client works with grants, they create a grant project and create tasks. But after they finish and start another project, the same tasks all apply with the addition of a few.

A lot of project management solutions out there allow you to create a clean project full of tasks, then save it as a template. So when you create a new project, you can create it from a template and it loads all the tasks. I would like to see this same functionality in Drupal. Node Clone isn't enough as its not productive to singularly clone each task ( at that point you minus well just create a new task from scratch ).

TravisJohnston’s picture

How does this work? I applied the patch, created a new VBO view and there is no clone operations to choose from...

TravisJohnston’s picture

ah i think i got it, awesome! Just need to now figure out how to then apply the copied nodes to the new project. Need to somehow have a node reference field included in vbo...

xaa’s picture

hi, #10 seems working fine thank you.

arkjoseph’s picture

Im trying to apply the patch to clone.module in d6 and im having trouble getting the patch to apply (#10). Also, can someone provide an outline as to where I can enable the vbo node clone? If its in the views edit vbo settings screen, please post.

thanks!

skyredwang’s picture

One use case: clone the same nodes many times as PM issues, and assign each issue to a (different) user. Doing this, we can track each issue status with different user.

skyredwang’s picture

The patch in #450000: Rules Integration (action) with Node Clone integrates Node Clone with Rules, which could be used as action for VBO. This 3 way integration is actually more powerful. For example, if you want to clone a node 1000 times, but want a specifically different Author for each cloned node; then you can use VBO for selecting users and execute the Rules based action for each selected user.

pwolanin’s picture

FileSize
9.07 KB

It seem like 7.x wants you to use hook_ation_info?

Here's a patch that seems to work fine that way - reactors some code, and within the action allows regex substitution in title and body.

While you could re-save all the nodes via Rules, seems like it's preferable to change the text first.

skyredwang’s picture

Status: Needs review » Reviewed & tested by the community

FYI: via Rules, it can make the change first before saving the node; Although, I don't know if there exist a simple action to do the regex substituion in this patch.

Anyway, this patch works fine!

skyredwang’s picture

#24 patch defined an action, using hook_action_info(), which is a core hook. However, this definition cannot be used by Rules.

Although, the outdated Rules documentation says:

Rules automatically converts the action info return by hook_action_info() to the rules format and add it's to it's own action infos (hook_rules_action_info()). This means you can use hook_rules_action_info_alter() to customize the action info for rules to add a custom label callback or to do other things

https://drupal.org/node/299055

pwolanin’s picture

A bit strange. I'd like this to be available to VBO without needing Rules necessarily, and seems counter-productive to have it 2x (where it will be seen by VBO as both an action and a rule?)

thedavidmeister’s picture

I don't want to rely on Rules for functionality like this.

kenorb’s picture

Tested and it works.
Apart of typo: Anyonmymous
Should be: Anonymous

pwolanin’s picture

FileSize
9.03 KB

re-rolled for the entity cache fix (which was basically included)

pwolanin’s picture

Status: Reviewed & tested by the community » Fixed

committed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Anonymous’s picture

I just had a use case where I needed to clone hundreds of nodes on a site. I was able to do it quite quickly using the following modules alongside VBO:

Replicate
https://drupal.org/project/replicate

Replicate UI
https://drupal.org/project/replicate_ui

I just enabled these modules and then configured my view 's VBO settings to allow for replication of nodes. It worked right away with no custom code.

  • Commit a8f11d6 on 7.x-1.x, 8.x-1.x by pwolanin:
    Issue #1316284 by pwolanin: Add Views Bulk Operations integration with...
myDrupal2014_846824658246’s picture

Issue summary: View changes

Hi,

Nice work ! I made a VBO with bulk action "Clone node" and a rule. The VBO is selecting 1 specific node.
Used the action: Load a list of entity ids from a VBO View.
Execute rule. result: no new node...

What should I do more ?