I used the 'CLONE MENU LINKS' feature of the clone module and ran into a problem.
I used the 'prepopulate' approach and on the prepopulated form the menu fields are correctly prefilled.
On submit the menu item is saved to the menu_links table and appears in the menu.
So far so good.

BUT

If I go and edit the clone (the copy not the original) the menu information does not show up in the node edit form anymore as if it was never set.
The solution was simple, in the function
function clone_node_clone_menu_link($node) {....}
where the menu properties are copied from the old node to the new one, you just have to also copy the 'module' propery
$link['module'] = $old_link['module']
This field seems to indicate which module maintains this menu item. And if this field is not set to 'menu' (so that the menu module is the maintainer of that item) than the menu module just ignores the item and it is not loaded into the node edit form.

Hope this helps.
Cheers.

CommentFileSizeAuthor
#1 921524-link-module.patch619 bytespwolanin

Comments

pwolanin’s picture

Status: Active » Needs review
StatusFileSize
new619 bytes

Thanks, this should be the patch.

pwolanin’s picture

Status: Needs review » Fixed

i think this was fixed in #921524: Problem with cloned menu item

Status: Fixed » Closed (fixed)

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