Hi Guys, i would love to have cloning feature as i will be adding 900 products ahead of me. Just installed cloning and found its throwing these 11 errors. Please help. Is there is any special way i can install cloning to make it work???? Thanks in advance.

Notice: Undefined index: mlid in _menu_parent_depth_limit() (line 592 of /home/thehighb/public_html/carnity.com/carnity/modules/menu/menu.module).
Notice: Undefined index: mlid in menu_form_node_form_alter() (line 630 of /home/thehighb/public_html/carnity.com/carnity/modules/menu/menu.module).
Notice: Undefined index: mlid in menu_form_node_form_alter() (line 644 of /home/thehighb/public_html/carnity.com/carnity/modules/menu/menu.module).
Notice: Undefined index: module in menu_form_node_form_alter() (line 644 of /home/thehighb/public_html/carnity.com/carnity/modules/menu/menu.module).
Notice: Undefined index: hidden in menu_form_node_form_alter() (line 644 of /home/thehighb/public_html/carnity.com/carnity/modules/menu/menu.module).
Notice: Undefined index: has_children in menu_form_node_form_alter() (line 644 of /home/thehighb/public_html/carnity.com/carnity/modules/menu/menu.module).
Notice: Undefined index: customized in menu_form_node_form_alter() (line 644 of /home/thehighb/public_html/carnity.com/carnity/modules/menu/menu.module).
Notice: Undefined index: options in menu_form_node_form_alter() (line 644 of /home/thehighb/public_html/carnity.com/carnity/modules/menu/menu.module).
Notice: Undefined index: expanded in menu_form_node_form_alter() (line 644 of /home/thehighb/public_html/carnity.com/carnity/modules/menu/menu.module).
Notice: Undefined index: hidden in menu_form_node_form_alter() (line 644 of /home/thehighb/public_html/carnity.com/carnity/modules/menu/menu.module).
Notice: Undefined index: mlid in menu_form_node_form_alter() (line 661 of /home/thehighb/public_html/carnity.com/carnity/modules/menu/menu.module).

CommentFileSizeAuthor
#10 1325028-10.patch1.14 KBpwolanin
#3 node_clone_menuclone.diff759 bytesipaq3870
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pwolanin’s picture

Status: Active » Postponed (maintainer needs more info)

Those are notices, not errors. Did the cloning fail for you?

They are coming from the menu module, so possible we need to set some more default values when cloning menu links

carnity’s picture

No it did not cloned the node (product) that i wanted and displayed following errors.

I am using corporate clean template theme, in case that help in fixing the dropdown type menu glitch (if any).

ipaq3870’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
759 bytes

A quick and dirty fix to add back those missing fields expected by menu.

pwolanin’s picture

Status: Needs review » Needs work

This looks wrong - should probably be NULL?

$link['mlid'] = -1;
KarenS’s picture

Even if you fix those values this doesn't work when prepopulating a node. The menu option is not chosen in the form so you won't see any preset value. You can change the menu before you save the node, but there is nothing 'cloned' about that process. I tried various things, like saving the menu link before displaying the form so that the menu already exists, and that makes the menu options work, but then you end up with two menu items, one pointing to the old node and one to the new one. I can't find any way to get the module to clone menu links in the prepopulate method.

Taxoman’s picture

Title: Clone failing, resulting 11 errors. » Not cloning menu entries
jkristos’s picture

For me it not only throws those errors, but won't save (and throws the error below) if I choose to "provide a menu link" because there seems to be no value for hidden, not sure if these are related to the missing default values or not....

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'hidden' cannot be null: INSERT INTO {menu_links} (menu_name, plid, link_path, hidden, external, has_children, expanded, weight, module, link_title, options, customized, updated) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12); Array ( [:db_insert_placeholder_0] => menu-careers [:db_insert_placeholder_1] => 0 [:db_insert_placeholder_2] => node/141 [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => [:db_insert_placeholder_7] => -45 [:db_insert_placeholder_8] => menu [:db_insert_placeholder_9] => Clone of Test Page [:db_insert_placeholder_10] => N; [:db_insert_placeholder_11] => [:db_insert_placeholder_12] => 0 ) in menu_link_save() (line 3111 of /opt/testsite/www/includes/menu.inc).

BrightBold’s picture

Agreed, this doesn't work. I got the following error:
Notice: Undefined index: language in clone_node_clone_menu_link() (line 141 of /srv/bindings/27b55f9b711141b793a3739da88cbe29/code/sites/all/modules/contrib/node_clone/clone.pages.inc).
and no clone of the menu item. Rats — this would be great functionality.

hexabinaer’s picture

Confirm.
PDOException and some 14 "undefined index" notices for mlid like given above while "Save" results in an error page and does not clone the given node.
Workaround
* Uncheck "provide a menu link"
* Save
* Set the menu link after cloning.

pwolanin’s picture

Status: Needs work » Needs review
FileSize
1.14 KB

Patch was out of date. I see why -1 for mlid is useful.

This is working better for both cloning methods.

Need tests for this whole module, obviously.

pwolanin’s picture

Status: Needs review » Fixed

committed my last patch

  • pwolanin committed 429cbc1 on 7.x-1.x
    Issue #1325028 by pwolanin, ipaq3870: fox for Not cloning menu entries
    

  • pwolanin committed 429cbc1 on 8.x-1.x
    Issue #1325028 by pwolanin, ipaq3870: fox for Not cloning menu entries
    

Status: Fixed » Closed (fixed)

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