Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#30 | 1316284-30.patch | 9.03 KB | pwolanin |
#24 | 1316284-24.patch | 9.07 KB | pwolanin |
#10 | add_node_operation-1316284-10.patch | 870 bytes | kscheirer |
#9 | add_node_operation-1316284-9.patch | 532 bytes | kscheirer |
Comments
Comment #1
RobLoachNot sure how useful cloning 10 different nodes at the same time would be. Is this what you were asking?
Comment #2
dawehnerYes, this is the concrete use case here. I have to apologise but it's a client idea :)
Comment #3
dawehnerThis 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 :)
Comment #4
sharp6621 CreditAttribution: sharp6621 commentedI 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.
Comment #5
texas_taterHey 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 :)
Comment #6
goodeit CreditAttribution: goodeit commentedI 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!
Comment #7
xaa CreditAttribution: xaa commentedhi, 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 !)
Comment #8
thedavidmeister CreditAttribution: thedavidmeister commentedI 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.
Comment #9
kscheirerThis 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.
Comment #10
kscheirerSorry, 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.
Comment #11
Sinan Erdem CreditAttribution: Sinan Erdem commentedIs #10 a patch for D6 or D7 ?
Comment #12
kscheirerD6, 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.
Comment #13
cphilli12 CreditAttribution: cphilli12 commentedI 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.
Comment #14
BrightBoldAlso 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.
Comment #15
kscheirerThe 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?
Comment #16
ezeedub CreditAttribution: ezeedub commentedFrom VBO for Drupal 7 docs
Comment #17
TravisJohnston CreditAttribution: TravisJohnston commented+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 ).
Comment #18
TravisJohnston CreditAttribution: TravisJohnston commentedHow does this work? I applied the patch, created a new VBO view and there is no clone operations to choose from...
Comment #19
TravisJohnston CreditAttribution: TravisJohnston commentedah 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...
Comment #20
xaa CreditAttribution: xaa commentedhi, #10 seems working fine thank you.
Comment #21
arkjoseph CreditAttribution: arkjoseph commentedIm 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!
Comment #22
skyredwangOne 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.
Comment #23
skyredwangThe 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.
Comment #24
pwolanin CreditAttribution: pwolanin commentedIt 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.
Comment #25
skyredwangFYI: 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!
Comment #26
skyredwang#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:
https://drupal.org/node/299055
Comment #27
pwolanin CreditAttribution: pwolanin commentedA 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?)
Comment #28
thedavidmeister CreditAttribution: thedavidmeister commentedI don't want to rely on Rules for functionality like this.
Comment #29
kenorb CreditAttribution: kenorb commentedTested and it works.
Apart of typo: Anyonmymous
Should be: Anonymous
Comment #30
pwolanin CreditAttribution: pwolanin commentedre-rolled for the entity cache fix (which was basically included)
Comment #31
pwolanin CreditAttribution: pwolanin commentedcommitted
Comment #33
Anonymous (not verified) CreditAttribution: Anonymous commentedI 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.
Comment #35
myDrupal2014_846824658246 CreditAttribution: myDrupal2014_846824658246 commentedHi,
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 ?