Clone also the menu entry

Frank Steiner - April 22, 2008 - 09:53
Project:Node clone
Version:6.x-1.0-beta1
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

Hi,

it would be nice if a cloned node would get a "clone of " menu entry that was below the same parent menu as the original node.

cu,
Frank

#1

pwolanin - April 26, 2008 - 14:11
Status:active» postponed

Hmm, this might not be so hard for 6.x, but I'm really not sure this is a widely desired feature.

#2

Frank Steiner - June 2, 2008 - 14:45
Status:postponed» needs review

Hi,

we need that on our site, so I've made menu cloning a configurable option. You can activate "Clone menu entry" at the settings page for the clone module. The patch is conservative in that the option defaults to "off".

Maybe someone else finds it useful :-) It's against 6.x-1.0-beta2.

cu,
Frank

AttachmentSize
clone_menu.patch 2.25 KB

#3

pwolanin - June 2, 2008 - 18:52

This could even be done a little more simply, though the code looks basically fine.

#4

Kristi Wachter - August 12, 2008 - 05:39

Just chiming in to say I definitely want this feature, and I hope you'll include the patch in the next release.

Thanks!

Kristi

#5

cozzi - August 29, 2008 - 20:12

Given the number of times I clone a menu (one for authenticated users and one for anonymous users) anything that would make that job easier would be a great help. If this feature will make light of this I too would use it.

#6

guysaban - November 16, 2008 - 12:51

Any chance you can make this patch for the latest version of the Node Clone module?

#7

Frank Steiner - November 17, 2008 - 07:55

Not sure what you mean. The patch applies to the 1.0 and the latest -dev version?

#8

guysaban - January 27, 2009 - 09:37

I could not apply the patch. I must check my setup further before I make any comments. Thanks for the getting back to me.

#9

Frank Steiner - January 27, 2009 - 12:39

It should be applied in the node_clone/ directory with "patch -p0 < clone_menu.patch"

#10

Frank Steiner - February 27, 2009 - 17:15

Bug fix. The menu entry didn't get the module-field set causing problems when re-editing a cloned node.

AttachmentSize
clone_menu_v2.patch 2.24 KB

#11

Frank Steiner - March 10, 2009 - 10:35

Forgot to remove two fields from the cloned menu, causing the new menu entry to overwrite the old one (because it the same mlid).

AttachmentSize
clone_menu_v3.patch 2.37 KB

#12

pwolanin - March 18, 2009 - 23:28
Status:needs review» needs work

Please conform to Drupal standard code style.

#13

Frank Steiner - March 19, 2009 - 07:38
AttachmentSize
clone_menu_v4.patch 2.37 KB

#14

pwolanin - March 20, 2009 - 02:24

see: http://drupal.org/coding-standards

e.g.:

$new_menu['has_children']=0;

You might also want to use: http://drupal.org/project/coder

#15

Frank Steiner - March 20, 2009 - 09:43

I'm sorry :-( I AM using the coder module and it didn't return any more warnings for my _v4 version, so I relied on this. My version might be outdated, I will check, and try to work on it manually otherwise...

#16

Frank Steiner - March 20, 2009 - 09:58

Ok, coder indeed doesn't find the "x=y" problem, using the latest dev from Jan 21. I was just relying on this, my fault!

I've checked against the coding standards weg page and corrected some indents, the assignments etc. I hope everything is correct now. I'm really sorry about this!

AttachmentSize
clone_menu_v5.patch 2.25 KB

#17

Frank Steiner - March 30, 2009 - 13:10

I've re-worked the patch and changed the direction of the menu creation, i.e., I start with a default menu object and fill in only those values that you can enter in the form. I hope this will be more "future-safe" than cloning the existing menu item and resetting those settings that I'm currently aware of. Those "hidden" settings might change more often.

AttachmentSize
clone_menu_v6.patch 2.22 KB
 
 

Drupal is a registered trademark of Dries Buytaert.