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.
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 CreditAttribution: malc0mn commentedPlease retest with the latest release and let me know if this is fixed now...
Comment #2
malc0mn CreditAttribution: malc0mn commentedThis is definitely fixed with the new port from scratch...