I'm using the latest dev version of node symlinks (dev dated 23/3/12) with Drupal 7 and the basic functionality of providing an extra link to the same page seems to be working well however when saving any page I get the message.

Notice: Undefined index: items in _nodesymlinks_nodeapi_insert_update() (line 93 of /home/sites/testing.com/public_html/sites/all/modules/nodesymlinks/nodesymlinks.inc).

Has anyone had similar or have any pointers as to what to start looking at?

CommentFileSizeAuthor
#4 undefined_index_in_items-1539340-2.patch673 bytesmoskito

Comments

moskito’s picture

It is caused due the fact that $node->menu['nodesymlinks']['items'] doesn't is set if "Provide a menu link" is not checked in node add form.

The follow code fixed it:

function _nodesymlinks_nodeapi_insert_update(&$node, $op) {
  $count_deleted = $count_saved = 0;
  
  $items = array();
  $saved_items = array();
  
  if (!empty($node->menu['nodesymlinks']['items'])) {
    $items = $node->menu['nodesymlinks']['items'];
  }
  
  // Save all menulinks from form (insert/update is handled by Menu API)
  foreach ($items as &$item) {

I'm quite busy now, but I'm going to send a patch later in the day.

ollie222’s picture

Thanks for looking at this and for providing the solution.

Applying the change above in the file nodesymlinks.inc has indeed solved the problem for me.

ollie222’s picture

I also wanted to say thanks to the creator of the module, it serves a very useful purpose and does it's job well.

moskito’s picture

Status: Active » Needs review
StatusFileSize
new673 bytes

Here it goes. Patch of fix in #1.

wojtha’s picture

Status: Needs review » Closed (fixed)

Thanks! Commited.