there are a few things missing in the new_menu array, needed to :
- specify the name of the parent menu ( otherwise the new item is always created for the 'navigation' menu )
- set the langcode, when the node is translatable.

          $new_menu = array(
            'link_path' => 'node/' . $node->nid,
            'link_title' => $node->title,
            'menu_name' => $parent_menu[0],
            'plid' => $parent_menu[1],
            'options' => array()
            //'customized' => true, // ?
          );
          if ( $node->language )
              $options = array('langcode' => $node->language);

Comments

j0nathan’s picture

subscribing

corneverbruggen’s picture

Assigned: Unassigned » corneverbruggen
Status: Active » Fixed

Thanks. That info should indeed be included. Added these changes to the module after some adjustments.

Status: Fixed » Closed (fixed)

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