array index is being accessed without being verified if it even exist.

i apologize to mark this RTBC but i ahve a feeling setting it to 'code needs review' wont be enough. patch is small enough to go straight for RTBC.

thanks.

CommentFileSizeAuthor
template-menus.php_.patch671 byteslitwol

Comments

johnalbin’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

notice: Undefined index: type....

A full error message would have been useful. Especially since I've never seen a warning message appear from within template-menus.php.

Also, I have a feeling this might only show up occasionally, under what circumstances do you experience this warning notice?

litwol’s picture

i hate to come off as a smart ass, but i experience this warning when type is index is being access withut being set.

johnalbin’s picture

i hate to come off as a smart ass, but i experience this warning when type is index is being access withut being set.

Oleg, on what page or under what circumstances is $link['type'] not set?

The patch does look RTBC, but I need to reproduce the bug in order to verify the patch fixes the bug.

litwol’s picture

unfortunately this has been too long ago and i do not recall the circumstances.

johnalbin’s picture

Title: (fix patch attached) notice: Undefined index: type.... » notice: Undefined index: type....
Status: Postponed (maintainer needs more info) » Needs review

I think this might hint at a bug in the Drupal 6 menu system, but I can’t verify the bug, so perhaps it's been fixed.

litwol’s picture

if you are implying that $link['type'] must _always_ be set in drupal core... if so then yes. otherwise this is not a drupal bug and a check should be made if array key exists before accessing it...

johnalbin’s picture

Status: Needs review » Closed (duplicate)

You know what, I think this is a dupe of #207321: Zen 6.x: PHP Notice in template-menus.php on pages with tabs

Which was a bug in Drupal 6 before 6.0-rc3.