Hi,
When I touch a page which does not exist in my site, a 404 error, I got:

Undefined offset: 1 in menu_block_split_get_first_level() (line 274 of sites/all/modules/menu_block_split/menu_block_split.module

Thanks for looking into this!
Greetings, Martijn

Comments

Summit’s picture

Hi,

I added 2 lines to the module to remove this error:

  $trail[1]['mlid'] = 0;
  $trail[1]['title'] ='';

Full function is:

function menu_block_split_get_first_level($trail) {
  $trail[1]['mlid'] = 0;
  $trail[1]['title'] ='';
  $info = array(
    'mlid' => isset($trail[1]['mlid']) ? $trail[1]['mlid'] : NULL,
    'title' => $trail[1]['title'],
  );
  return $info;
}

Is this correct?

Greetings, Martijn

oliversk’s picture

I have the same problem - when using your function it disappears

However, it does not fix the actual problem: Both menus the main menu and submenu are gone from the frontpage (they are still on content sites)

Am I missing something? Sorry new to Drupal 7

Summit’s picture

Hi,
Maybe the values should be set somewhere else...can may be module maintainer help please?
greetings, Martijn

hutch’s picture

I can't replicate this, but try this:

function menu_block_split_get_first_level($trail) {
  $info = array(
    'mlid' => (isset($trail[1]['mlid']) ? $trail[1]['mlid'] : NULL),
    'title' => (isset($trail[1]['title']) ? $trail[1]['title'] : ''),
  );
  return $info;
}
howdytom’s picture

@ hutch:

I am able to replicate the Undefined offset: 1 in menu_block_split_get_first_level( issue too.

Your code fixes the issue. Thank you!

hutch’s picture

Status: Active » Needs review

Commited in D6 and D7

nicodv’s picture

Hi, I just found I had same problem here.
In case it helps, the menus were in the home, then I deleted some basic pages (CT) and articles and then I saw the error mentioned in this issue. Updated the module with the latest version, and the error is gone, but the menus are not showing up still.

Any other idea?

thanks

nico