notice: Undefined index: type....

litwol - March 9, 2008 - 04:54
Project:Zen
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:duplicate
Description

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.

AttachmentSize
template-menus.php_.patch671 bytes

#1

JohnAlbin - April 14, 2008 - 11:42
Status:patch (reviewed & tested by the community)» active (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?

#2

litwol - April 14, 2008 - 20:04

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

#3

JohnAlbin - April 14, 2008 - 20:22

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.

#4

litwol - April 14, 2008 - 22:03

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

#5

JohnAlbin - May 13, 2008 - 05:22
Title:(fix patch attached) notice: Undefined index: type....» notice: Undefined index: type....
Status:active (needs more info)» patch (code 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.

#6

litwol - May 14, 2008 - 01:29

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...

#7

JohnAlbin - May 14, 2008 - 12:08
Status:patch (code needs review)» 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.

 
 

Drupal is a registered trademark of Dries Buytaert.