Quantcast

Minor bug fix for users with no roles

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Minor bug fix for users with no roles

McBride, Ian S.
Thanks for the updated rss_page module. After loading this and the base monster_menus module updates, I got a PHP Notice when logged in as a user with no roles. I've initialized the $added_role variable outside the while loop scope in the boot hook to fix this.

---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=424496
or send a blank email to [hidden email]

monster_menus.module.patch (1006 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Minor bug fix for users with no roles

Dan Wilga-2
At 10:06 AM -0400 6/15/09, McBride, Ian wrote:
>Thanks for the updated rss_page module. After loading this and the
>base monster_menus module updates, I got a PHP Notice when logged in
>as a user with no roles. I've initialized the $added_role variable
>outside the while loop scope in the boot hook to fix this.

I'll add the patch, because it is a good idea to initialize
variables. But I don't think this could have caused your problem;
uninitialized variables don't evaluate to logical TRUE.
--
Dan Wilga                                 [hidden email]
Web System Administrator/Programmer             http://www.amherst.edu
Amherst College                                      Tel: 413-542-2175
Amherst, MA  01002

---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=424535
or send a blank email to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Minor bug fix for users with no roles

McBride, Ian S.
In reply to this post by McBride, Ian S.
That's correct, the script will still work since it will evaluate false, but PHP will generate a Notice when it encounters an uninitialized variable in a conditional check, which I want to get rid of if possible to make logging cleaner. We could have also changed this to read:

if (isset($added_role) && $added_role ...

but it seemed better to just initialize it to get rid of the Notice.

-----Original Message-----
From: Dan Wilga [mailto:[hidden email]]
Sent: Monday, June 15, 2009 10:36 AM
To: Monster Menus Development
Subject: Re: Minor bug fix for users with no roles

At 10:06 AM -0400 6/15/09, McBride, Ian wrote:
>Thanks for the updated rss_page module. After loading this and the
>base monster_menus module updates, I got a PHP Notice when logged in
>as a user with no roles. I've initialized the $added_role variable
>outside the while loop scope in the boot hook to fix this.

I'll add the patch, because it is a good idea to initialize
variables. But I don't think this could have caused your problem;
uninitialized variables don't evaluate to logical TRUE.
--
Dan Wilga                                 [hidden email]
Web System Administrator/Programmer             http://www.amherst.edu
Amherst College                                      Tel: 413-542-2175
Amherst, MA  01002

---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685439.7e7cbccf9bb225cf8471bffe1cb67503&n=T&l=monster_menus&o=424535
or send a blank email to [hidden email]

---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=424543
or send a blank email to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Minor bug fix for users with no roles

Dan Wilga-2
In reply to this post by McBride, Ian S.
At 11:23 AM -0400 6/15/09, McBride, Ian wrote:
>That's correct, the script will still work since it will evaluate
>false, but PHP will generate a Notice when it encounters an
>uninitialized variable in a conditional check, which I want to get
>rid of if possible to make logging cleaner.

Ah, OK, you have strict checking turned on. There are probably going
to be lots (easily dozens) of places where this happens, then. It
would be best to fix them all in one patch. Have fun! :-)
--
Dan Wilga                                 [hidden email]
Web System Administrator/Programmer             http://www.amherst.edu
Amherst College                                      Tel: 413-542-2175
Amherst, MA  01002

---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=424546
or send a blank email to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Minor bug fix for users with no roles

McBride, Ian S.
In reply to this post by McBride, Ian S.
True enough. I actually went through and fixed them all in one of the early copies of MM we received, but then I updated to your latest dev copy on Friday. I'll work on compiling a patch of just these as I come across them again and post that to the list when it's ready.

-----Original Message-----
From: Dan Wilga [mailto:[hidden email]]
Sent: Monday, June 15, 2009 11:45 AM
To: Monster Menus Development
Subject: RE: Minor bug fix for users with no roles

At 11:23 AM -0400 6/15/09, McBride, Ian wrote:
>That's correct, the script will still work since it will evaluate
>false, but PHP will generate a Notice when it encounters an
>uninitialized variable in a conditional check, which I want to get
>rid of if possible to make logging cleaner.

Ah, OK, you have strict checking turned on. There are probably going
to be lots (easily dozens) of places where this happens, then. It
would be best to fix them all in one patch. Have fun! :-)
--
Dan Wilga                                 [hidden email]
Web System Administrator/Programmer             http://www.amherst.edu
Amherst College                                      Tel: 413-542-2175
Amherst, MA  01002

---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685439.7e7cbccf9bb225cf8471bffe1cb67503&n=T&l=monster_menus&o=424546
or send a blank email to [hidden email]

---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=424547
or send a blank email to [hidden email]
Loading...