Closed (fixed)
Project:
Menu clone
Version:
7.x-1.0-beta1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
28 Apr 2012 at 20:52 UTC
Updated:
17 Jul 2012 at 21:01 UTC
Thank you for this module!
I have tried module, and my experience was that the database query in function menu_clone_clone_form_submit is wrong.
Original version:
function menu_clone_clone_form_submit($form, &$form_state) {
$menu = $form_state['values'];
$path = 'admin/structure/menu/manage/';
$menu['menu_name'] = 'menu-' . $menu['menu_name'];
$link['link_title'] = $menu['title'];
$link['link_path'] = $path . $menu['menu_name'];
$link['router_path'] = $path . '%';
$link['module'] = 'menu';
$link['plid'] = db_query("SELECT mlid FROM {menu_links} WHERE link_path = :link_path AND module = :module", array(':link_path' => 'admin/build/menu', ':module' => 'system'))->fetchField();
I think, this is the right solution:
function menu_clone_clone_form_submit($form, &$form_state) {
$menu = $form_state['values'];
$path = 'admin/structure/menu/manage/';
$menu['menu_name'] = 'menu-' . $menu['menu_name'];
$link['link_title'] = $menu['title'];
$link['link_path'] = $path . $menu['menu_name'];
$link['router_path'] = $path . '%';
$link['module'] = 'menu';
$link['plid'] = db_query("SELECT mlid FROM {menu_links} WHERE link_path = :link_path AND module = :module", array(':link_path' => 'admin/structure/menu', ':module' => 'system'))->fetchField();
Comments
Comment #1
malc0mn commentedPlease retest with the latest release and let me know if this is fixed now...
Comment #2
malc0mn commentedThis is definitely fixed with the new port from scratch...