Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I'm pretty new to Drupal and PHP in general, so this may be obvious - But I'm working on with Drupal 7 with Node Clone installed as well as the Webform module. Recently, the "clone" link stopped appearing in the Operations column (had been there at some point) on the Content list page in the admin. The only place it is showing up now is for the individual form fields inside a Webform node. I'm needing to clone whole pages & webforms - not just the form fields.
Was thinking it was a permissions issue? But I'm logged in as administrator with all permissions on. Any help would be appreciated!
Comment | File | Size | Author |
---|---|---|---|
#27 | Screen shot 2012-08-07 at 10.41.06 AM.png | 111.96 KB | pwolanin |
#25 | 1161924-23.patch | 761 bytes | pwolanin |
#22 | 1161924-22.patch | 617 bytes | sdragnev |
#21 | 1161924-21.patch | 682 bytes | pwolanin |
#19 | clone_as_task.patch | 331 bytes | michaelfavia |
Comments
Comment #1
Jānis Bebrītis CreditAttribution: Jānis Bebrītis commentedreplace "MENU_LOCAL_ACTION" with "MENU_LOCAL_TASK" in clone.module line 50
Comment #2
dgreve CreditAttribution: dgreve commentedThanks Jancis! Looks like that added a clone tab within the edit page of each basic page node of the site (unless that was always there?), which is great - But still no "clone" link or tab showing up for any of the webform nodes. I add a new form to the site every few weeks using webform and will really stink having to recreate them everytime.
Let me know if there's any other info that might be helpful. Thanks!
Comment #3
Todd Young CreditAttribution: Todd Young commentedI followed #1 (line to edit was #51) to no avail. But like #2 I then saw the clone link for the first time in the view of the node - not even the edit? But still nothing in the operations area, if that was what was intended...
Comment #4
temosayin CreditAttribution: temosayin commentedHeres a patch to show a clone-link in the operation area
Comment #5
Fabianx CreditAttribution: Fabianx commentedComment #6
moshe weitzman CreditAttribution: moshe weitzman commentedComment #7
RobLoachThe patch wasn't applying before. So I updated it, and touched it up a bit.
Comment #8
ngottlieb CreditAttribution: ngottlieb commentedI am still not seeing the link after applying the first patch (second one returned an error). Anyone know of another solution out there?
Comment #9
Refineo CreditAttribution: Refineo commentedSorry, should this be "RTBC" or "needs work" now ?
Comment #10
johnv@refineo, if a patch is not working, status is 'needs work'.
After applying #7, the link shows up in /admin/content/node, however:
- title is better off with no Capital : 'title' => t('
Cclone'),- The link is shown even for nodes of types that cannot be cloned (the link ands in a Access denied page)
Comment #11
johnvAttached patch includes comments of #10
Comment #12
pwolanin CreditAttribution: pwolanin commentedminor - but
// issue 1161924, add clone-link to page admin/content/node
code comment it out of place in the patch and should be removed.Comment #13
johnva cleaner patch is attached.
Comment #14
pwolanin CreditAttribution: pwolanin commentedok, so there is a variable in there called $node, that should probably be $operations when looking at the base form
Also, you might want to just get all the nids and do:
http://api.drupal.org/api/drupal/modules%21node%21node.admin.inc/functio...
Comment #15
johnvI don't understand your first comment.
As for the second one: all nodes have been loaded in cache in an earlier stage, so fetching the nodes one-by-one has no impact on database-load.
Comment #16
pwolanin CreditAttribution: pwolanin commentedmaybe I'm misunderstanding the form structure.
is the thing you are iterating actually a node, or just a form element?
Comment #17
johnvThe foreach loops over the item list, which contains arrays. Then I set the list of operations.
The item list only contains nid as a useable variable. Node->type is not avaiable, but necessary for the access check. There for I must use node_load(), and cannot use the method you use in Views-integration (creating a new StdClass).
Any way, I didn't make it up myself, but copied from some place.
I'd say, just try it out!
Comment #18
dannygrimes CreditAttribution: dannygrimes commentedLast patch worked for me. Clone shows up in the content listing. Thanks to poster and dev.
Comment #19
michaelfavia CreditAttribution: michaelfavia commentedThe attached patch restores Clone to the local menu tabs next to view and edit. I realize this goes against current trends to move to actions for actionable elements but it is what our client wanted and most tend to. Incase anyone else needs it.
Don't forget to clear your cache after applying it.
Comment #20
johnv@michaelfavia, I think you have mixed up the issues. Your patch is already supplied in #1328682-2: Add a link to the contextual menu / or a tab for cloning the node
Comment #21
pwolanin CreditAttribution: pwolanin commentedChanged the variables to have more correct naming.
Comment #22
sdragnev CreditAttribution: sdragnev commentedThis patch work for 1.0-beta1 for me.
Comment #23
pwolanin CreditAttribution: pwolanin commentedMaybe needs a destination param for consistency with other links on that page?
Comment #24
pwolanin CreditAttribution: pwolanin commentedCommitted w/ destination added.
Comment #25
pwolanin CreditAttribution: pwolanin commentedoops - forgot the final patch
Comment #26
jajouka CreditAttribution: jajouka commentedit seems like the alterations in 1161924-23.patch have been included in the latest stable and dev releases. I am still not seeing the clone link using either of these version, thanks
Comment #27
pwolanin CreditAttribution: pwolanin commentedThey show for me - be sure to run update.php or a cache clear so that new hook implementations are discovered.
Comment #28
zerbash CreditAttribution: zerbash commentedI can see the clone link in the operations column as admin, but not as a user. The problem seems to lie in the $form['admin']['nodes'] array processed in clone_form_node_admin_content_alter(). As admin, the array has the ['#options'] element. As a user, this element is called ['#rows'].
If you change line 150 of clone.module
foreach($form['admin']['nodes']['#options'] as $nid => &$row){
to
foreach($form['admin']['nodes']['#rows'] as $nid => &$row){
the clone link will show up for users (will appropriate permissions), but no longer for admin.
Comment #29
pwolanin CreditAttribution: pwolanin commentedugh, well that's pretty stupid core code. The target of this is more for admins, but it would be nice to expose it for users too.
Comment #30
nfriend CreditAttribution: nfriend commentedI'm just taking a look at "Clone" for the first time in D7 - have it working in D6 without any problems.
I too see the "clone" option as Admin in the operations column. But I do not see the Tab next to View|Edit when viewing the node - not as Admin or as a role with clone permissions set.
Are all patches in the Aug 5 release? I did not try the Dev release as they look to be the same date.
Neil
Comment #31
nairb CreditAttribution: nairb commentedThe clone link was removed from the Tabs and is now in Actions. See 1328682 for more info. If you are using a theme you ported from D6, you may be missing the $action_links variable as I was. Try switching to Garland and you should see a clone content link.
Comment #32
nfriend CreditAttribution: nfriend commentedThanks for the tip @nairb -I really liked it on the tab area - only users with editing access typically have need for this feature and the small distraction an extra tab brings seems harmless.
I actually need it in a premium D7 theme and it does not show action links?!
However Views has an option (undocumented?) to include the Clone Link which works great!
My thanks to all contributors.
Neil
Comment #33
ParisLiakos CreditAttribution: ParisLiakos commentedWell lets move the discussion on the bug here:
#1762106: Invalid arguments supplied for foreach() there is a patch there
Comment #34
Taxoman CreditAttribution: Taxoman commentedFWIW, I also think that the Node Clone action should be (optionally) visible as a _tab_, even if also found under actions.
Comment #36
knalstaaf CreditAttribution: knalstaaf commentedThe patch in #25 gives me this:
Fatal error: Cannot redeclare clone_form_node_admin_content_alter() (previously declared in /home/usr1/domain/public_html/sites/all/modules/node_clone/clone.module:165) in /home/usr1/domain/public_html/sites/all/modules/node_clone/clone.module on line 201
Update.php gives me a WSOD.
Impossible to clear cache (no access to Drush).
No tab in node form either.
Comment #38
pwolanin CreditAttribution: pwolanin commentedfixed up in #1903272: Fix clone operation on admin/content for users without "Administer Content" permission