Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi
Drupal started throwing up an error as in the title:
Notice: Undefined index: title in zentropy_links() (line 891 of /var/www/dev/cccj/sites/all/themes/zentropy/template.php).
I found the line in the template which is trying to find a title key whilst going over menu items, and looks like it can't find the key.
I just did something below, to check if the key exists and if not add nothing which made the error go away.
Perhaps you'll be able to put in something better written to accomodate this issue.
$custom_class = "";
if (isset($link['title'])) {
$custom_class = drupal_html_class($link['title']);
}
// Add extra class to menu items.
//$custom_class = drupal_html_class($link['title']);
$class[] = $custom_class;
$output .= '<li' . drupal_attributes(array('class' => $class)) . '>';
Comments
Comment #1
creaoy CreditAttribution: creaoy commentedIt is strange behavior when $link array doesn't have title index.
I guess somewhere in code you have something like unset($link['title']);
Comment #2
creaoy CreditAttribution: creaoy commentedIt is strange behavior when $link array doesn't have title index.
I guess somewhere in code you have something like unset($link['title']);
Comment #3
davidneedhamIndeed, seems to me like this is something in your own code as suggested by @creaoy.
Comment #3.0
davidneedhamWrong line number in content as I had changed the original code.