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.
Problem/Motivation
Add an option in admin in order to allow the administrator to hide the "clone" action links on node view.
A patch follows.
Comment | File | Size | Author |
---|---|---|---|
#9 | node_clone-add_option_hide_clone_links-2414451-3.patch | 1.15 KB | komlenic |
#7 | node_clone-add_option_hide_clone_links-2414451-2.patch | 1.08 KB | komlenic |
#1 | node_clone-add_option_hide_clone_links-2414451-1.patch | 1.08 KB | Kgaut |
Comments
Comment #1
Kgaut CreditAttribution: Kgaut commentedHere's the patch
Comment #2
Sylense CreditAttribution: Sylense commentedWorks. Had to clear cache before it worked. Thanks!
Comment #3
Rustan CreditAttribution: Rustan commentedWorks fine for me as well, thanks!
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedany chance to help me in the following feature request?
https://www.drupal.org/node/2482097
Comment #5
Morten Najbjerg CreditAttribution: Morten Najbjerg commentedAny chance this might be included in a module release?
Comment #6
Kgaut CreditAttribution: Kgaut commentedLast commit in the module is from 6 month ago, I don't know if pwolanin has the time/motivation to maintain this module.
If there's improvements to be done for the patch, let me know.
Comment #7
komlenic CreditAttribution: komlenic as a volunteer commentedThe patch in #1 above had a minor discrepancy -- the default value for 'display_clone_menu_link' variable is set in hook_menu to a value of 1, and in the admin form to a value of 0. Both values, if specified should be the same. That being said, I think the best default is to display the clone action/menu link (since that is in line with the purpose of the node_clone module).
This patch addresses the above. Thanks!
Comment #8
komlenic CreditAttribution: komlenic as a volunteer commentedComment #9
komlenic CreditAttribution: komlenic as a volunteer commentedWhile we're at it, let's add a note to indicate that the cache needs to be cleared for this setting to take effect.
Comment #10
Kgaut CreditAttribution: Kgaut as a volunteer commentedGreat !
#9 is RTBC for me.
Comment #11
kopeboy CreditAttribution: kopeboy commentedPlease can we include this?
I was surprised that with so many installs this feature wasn't already in.
The action link is quite intrusive!
Comment #12
Kgaut CreditAttribution: Kgaut as a volunteer commentedWe need to reach pwolanin in order to get this comited.
Comment #13
pwolanin CreditAttribution: pwolanin as a volunteer commentedMotivation for this feature?
Also, if a setting is going to change the router, you'd need to handle the rebuild on form submit rather than telling the admin to clear caches.
Comment #14
pwolanin CreditAttribution: pwolanin as a volunteer commentedI don't understand the motivation for this proposed feature.
Comment #15
komlenic CreditAttribution: komlenic as a volunteer commentedThe motivation for this feature is to have the functionality that this module provides (cloning nodes) without necessarily needing or wanting the action link to appear by default.
Marking this as "won't fix" is certainly up to your discretion @pwolanin, but there are several working patches here that do not hinder or otherwise complicate the module, and that several users above have found a need/use for. This tiny feature seems all but complete.
Comment #16
Kgaut CreditAttribution: Kgaut as a volunteer commentedAgreed with komlenic.
When I started this issue I wanted to get the ability to clone nodes but only from a specific dashboard.
For somes sites with a lot of contributors (non technical) we want to keep the administration as simple as possible.
So I created this patch to not display the clone links on nodes.
Comment #17
jlstreckerI'd like this feature, too. I'm just using node clone in a rules action. I'd prefer not to have it affect the rest of the site by adding an action link to every node.
Thanks to the folks who submitted patches.
Comment #18
grahamvalue CreditAttribution: grahamvalue commentedSeconded.
Comment #19
grahamvalue CreditAttribution: grahamvalue commentedIn case it helps anyone, the following css placed on the affected nodes (possibly in a block) will hide the clone link.
But please note that this code will hide all action links on the node.
Hiding the clone link alone leaves an empty action section on the nodes.
Comment #20
eit2103 CreditAttribution: eit2103 commented@komlenic your patch helped me too, thank you!