In includes/theme.inc, theme_links() produces

Notice: Undefined index: query in c:\program files\apache group\apache\htdocs\drupalhead\includes\theme.inc on line 534
Notice: Undefined index: fragment in c:\program files\apache group\apache\htdocs\drupalhead\includes\theme.inc on line 534

The offending line:

        $output .= l($link['title'], $link['href'], $link['attributes'], $link['query'], $link['fragment']);

may be called with $link['query'] and/or $link['fragment'] unset. (Maybe also attributes too?). The link function l() defaults to NULL if query and fragment are not supplied (which is luckily what you get from an undefined value anyway), so we can fix this without changing the logic to:

        $output .= l($link['title'], $link['href'], $link['attributes'], isset($link['query']) ? $link['query'] : NULL, 
                      isset($link['fragment']) ? $link['fragment'] : NULL);

The attached patch fixes this line. Mark.

PS I hope these are useful, but do stop me if this is becoming silly...

CommentFileSizeAuthor
#3 theme-links-notice_0.patch813 byteswebchick
theme.inc_13.patch869 bytesplumbley
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

beginner’s picture

I cannot test this patch because of non-standard line endings.
Please provide a patch with Unix line endings as per guidelines: http://drupal.org/patch .

beginner’s picture

Status: Needs review » Needs work
webchick’s picture

Version: x.y.z » 5.x-dev
Status: Needs work » Needs review
FileSize
813 bytes

Here's another version. I chose to initialize those variables before that line for readability.

drumm’s picture

Status: Needs review » Fixed

Committed to HEAD. I went with NULL instead of '' to match the default arguments for l().

Anonymous’s picture

Status: Fixed » Closed (fixed)