I get the following notice
php: Notice: Undefined index: uc_ssl_check in uc_ssl_check() [error]
(line 288 of uc_ssl/uc_ssl.module)
It appears that the code checks to see if this variable exists, but it throws an error during this check if it does not already exist. I am not quite sure if the code wants to check if it exists and the variable is not null, or only that it exists at all.
therefore the code which would solve both solutions would be to change line 288 from
if ($_GET['uc_ssl_check'])
to
if ($_GET['uc_ssl_check'] && isset($_GET['uc_ssl_check']))
or if the value of uc_ssl_check is either there, set to null, or not there the simplest code would be
if (isset($_GET['uc_ssl_check']))
Comments
Comment #1
westwesterson commentedalso, it would seem for my scenario the bottom most fix works.
Other info:
using Pressflow which turns on all error messages including undefined indexes,
this error shows up in the drush console and in watchdog
Comment #2
crystaldawn commentedThe logic of that check is as such: IF $_GET['uc_ssl_check'] is set AND it is NOT null, then do the following. So if you want to get rid of the notice, it would have to be written in that fashion because PHP runs left to right, not right to left.
You do NOT want to use JUST isset() because all isset does is check to see if the variable has been initialized. It will NOT tell you if the variable is actually null or not. So you've introduced a bug into your app if you have it using just the isset. And the solution you have just above that, it didnt work properly because you wrote it backwards. Replace it with what I have here and you should get the desired result. The error that you are seeing btw, is NOT an error. It's exactly what it says, it's a NOTICE. Not an error. It's simply telling you that a variable that you are checking was never actually "initialized" with anything and thus it may be empty. It's suppose to help create better coding, but I do not run with notices on so I rarely see these types of messages. And since they do not really mean anything to me, I have no need to see them.
See, the part that is throwing the error is the checking of the $_GET variable. So, since PHP checks left to right, it would first check isset. If isset were to come back false, it would stop right there and not even evaluate the right side of the && which is where your Notice error is coming from. But if you do it backwards, it WILL evaluate it and thus you'd still receive that Notice message. And if the isset comes back as TRUE, then since the $_GET var is filled with something, then it was obviously initialized and again you would not get that Notice when it checks $_GET.
So there ya have it, a quick PHP 101 regarding PHP evaluation process and why Notice messages are so confusing and useless :D
Comment #3
crystaldawn commentedComment #4
westwesterson commentedthanks, my bad,
don't know why i had that backwards.
And I hadn't done the check of the logic.
However, I think this should probably be fixed in the module before it is closed. Might as well get rid of the notices for other people with the same situation, and so it doesn't come back if I were to upgrade.
patch included
Comment #5
westwesterson commentedComment #6
m.stentaBump. This needs to be fixed.
Drupal 7, as well as Pressflow for 6, enable full PHP error reporting, including notices. It is better practice to fix the code than it is to ignore it.
The patch in #4 works for me.
Comment #7
crystaldawn commentedComment #8
crystaldawn commentedComment #9
m.stentaIs this actually fixed? I don't see any recent commits for it.
Apologies if you just haven't pushed it up yet. But don't close the ticket if the issue isn't fixed.
Comment #10
crystaldawn commentedI fixed this for 7.x not 6.x. I havent gone through 6.x yet, I just updated 7.x last night and was closing all the issues to clean out the queue. This will be closed soon for 6.x once I push the same updates for that later this week. Didnt notice this was tagged as 6.x :P
Comment #11
crystaldawn commentedComment #12
crystaldawn commented