My error log is being filled up with this error notice.

Notice: Undefined index: #original_link in boilerplate_menu_link() (line 180 of /home/play123/public_html/sites/all/themes/boilerplate/template.php).

I have seen that #original_link has resulted in similar error in two other themes where issues have been lodged, as described in the adaptive theme http://drupal.org/node/1453662 and in the sasson theme http://drupal.org/node/1458848.

thanks.

Comments

Renzy’s picture

I have deleted the following code from lines 180 181 in the template.php file. This has fixed the error and I cannot see any problems associated with this change? But will leave it up to maintainer to advise of correct fix to be added to next release.

$element['#attributes']['class'][] = 'mid-' . $element['#original_link']['mlid'];
  return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . "</li>\n";
twardnw’s picture

rather than removing those lines, the method in #1458848: Undefined index #original_link is a better way to handle the error.

twardnw’s picture

Try this:

<?php
if (isset($element['#original_link']['mlid']) && !empty($element['#original_link']['mlid'])) {
    $element['#attributes']['class'][] = 'mid-' . $element['#original_link']['mlid'];
  }
  return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . "</li>\n";
?>
twardnw’s picture

Status: Active » Fixed

committed

Renzy’s picture

thanks, I actually did try this on my test site first as per one of those other posts, but it resulted in white screen. I should have edited my first response to say that I just removed the following section:

. $element['#original_link']['mlid']

on line 180, and this has worked. No more error msg and site not effected. However I will now download the latest version of boilerplate and check out the template file. to see if that works too.

Renzy’s picture

Status: Fixed » Closed (fixed)

The template file from latest commit works, many thanks, and will mark as closed.