Author |
Message |
Palbin
Site Admin

Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Mon Nov 10, 2008 6:46 pm |
|
I am getting the following notice everyone once in a while. I really can't give a way to repeat it consistenly, but it does appear. What is the best way to fix it? Just add a check to see if it is defined?
if (!isset($op)) { $op = ''; }
Notice: Undefined variable: op in /home/phpnukeg/public_html/raven/modules/Your_Account/includes/mainfileend.php on line 48 |
|
|
|
 |
Palbin

|
Posted:
Mon Nov 10, 2008 6:51 pm |
|
Ok I am logged in as a regular user and not an admin, and I seem to get it on just about every page other than your_account. |
|
|
|
 |
fkelly
Former Moderator in Good Standing

Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY
|
Posted:
Mon Nov 10, 2008 6:59 pm |
|
The check you added will work. We worked diligently to eliminate those from the RN version of YA before release but it looks like we missed some. If you can tell us what programs you are seeing that in it would be a big help.
While we want to eliminate the error, it's presence can sometimes be a symptom of a larger problem. For instance, just a quick glance at the code makes me question in what situations you would get there without $op being set. We need to look at that issue to. No sense putting a bandaid on a problem that needs a tourniquet. LOL, I don't know about that analogy but you get my point.
I'll put this over into our issue tracking for 2.3. Thanks again Palbin. |
|
|
|
 |
Palbin

|
Posted:
Mon Nov 10, 2008 7:19 pm |
|
I seem to get it everywhere other than when in your_account. In home, forums, survey, stats, etc...... |
|
|
|
 |
Palbin

|
Posted:
Mon Nov 10, 2008 7:25 pm |
|
I'll have to get back to you on this. It seems to have been cached some how. I'll have to try and reproduce this again. |
|
|
|
 |
fkelly

|
Posted:
Mon Nov 10, 2008 7:31 pm |
|
That truly is strange. We would have caught that in testing I am almost sure. Can you give a specific example where you are seeing that besides mainfileend? $op is usually used in case statements as a sort of director for what functions a program should call.
If it is not set it usually a symptom of deeper problems. |
|
|
|
 |
Palbin

|
Posted:
Mon Nov 10, 2008 7:37 pm |
|
Ok it shows up everywhere unless you are in your_account or admin.php. It will show up in admin.php when you first go to it, but as soon as you select any of the opions in admin it goes away.
From what I see this only requires a bandaid. |
|
|
|
 |
Palbin

|
Posted:
Mon Nov 10, 2008 7:44 pm |
|
Well I have a question. It appears that that function is supposed to display the TOS if it has changed. This doesn't appear to work. Was this thought of when the terms where moved to the legal module? Just some food for thought.  |
|
|
|
 |
fkelly

|
Posted:
Tue Nov 11, 2008 8:35 am |
|
I have spent the last 15 minutes trying to replicate the error on my test site: fkelly.org.
I can't. I set error reporting to E_ALL in rnconfig and display errors to true in config.php and I signed out of my admin account and into a normal user account and I don't see the $op related error anywhere. Could something possibly have gone wrong with your FTP process? |
|
|
|
 |
Palbin

|
Posted:
Tue Nov 11, 2008 9:28 am |
|
I'll do a clean install on a seperate sub-domain and see if I can replicate it. Just to make sure it is not something I did. |
|
|
|
 |
Dawg
RavenNuke(tm) Development Team

Joined: Nov 07, 2003
Posts: 928
|
Posted:
Wed Dec 31, 2008 7:46 am |
|
I am filling my log file full of these. What is causeing it is when people have not yet agreed to the TOS.
httpdocs/modules/Your_Account/includes/mainfileend.php on line 48
Line 48
Code:// modified by menelaos dot hetnet dot nl to reduce amount of sql-queries
// If user hasn't accepted updated TOS, display it until it has been accepted
if ($ya_config['tos'] == 1 AND $op != 'tos' AND $op != 'logout' AND $ya_config['tosall'] == 1 AND $uinfo['agreedtos'] != 1) {
if (!isset($_POST['tos_yes']) or $_POST['tos_yes'] != 1) {
$break = explode('/', $_SERVER['SCRIPT_NAME']);
$qS = $_SERVER['QUERY_STRING'];
$redirect = $break[count($break) - 1];
if ($qS > '') $redirect = rawurlencode(htmlentities($redirect . '?' . $qS));
header('Location: modules.php?name=Your_Account&op=tos&redirect=' . $redirect);
die();
}
|
I added this....
Code:if (!isset($op)) { $op = ''; }
|
Will this break any thing?
Code: // modified by menelaos dot hetnet dot nl to reduce amount of sql-queries
// If user hasn't accepted updated TOS, display it until it has been accepted
if (!isset($op)) { $op = ''; }
if ($ya_config['tos'] == 1 AND $op != 'tos' AND $op != 'logout' AND $ya_config['tosall'] == 1 AND $uinfo['agreedtos'] != 1) {
if (!isset($_POST['tos_yes']) or $_POST['tos_yes'] != 1) {
$break = explode('/', $_SERVER['SCRIPT_NAME']);
$qS = $_SERVER['QUERY_STRING'];
$redirect = $break[count($break) - 1];
if ($qS > '') $redirect = rawurlencode(htmlentities($redirect . '?' . $qS));
header('Location: modules.php?name=Your_Account&op=tos&redirect=' . $redirect);
die();
}
|
|
|
|
|
 |
Dawg

|
Posted:
Wed Dec 31, 2008 8:04 am |
|
Ya that broke something....No Admin panel.
Hmmm...will have to try again...
Dave |
|
|
|
 |
fkelly

|
Posted:
Wed Dec 31, 2008 8:27 am |
|
The if statement you have added looks okay to me. Do you have error reporting turned up to e_all so you will see notices? Looking back in the thread, this is something that is difficult for us to reproduce and that didn't show up in testing -- which was pretty extensive. Are you sure that all the files for YA got ftp'd okay?
Maybe you could put something in like
echo 'op at line 48 of mainfileend ' . $op . '<br />'
so you can see what the value coming in is. $op should be getting set by the program that includes mainfileend and as I said in an earlier post it is used in case statements throughout the administrative side of RN as a sort of traffic cop in case statements so having it set incorrectly can be "a very bad thing". |
|
|
|
 |
Guardian2003
Site Admin

Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Wed Dec 31, 2008 4:40 pm |
|
I made a Mantis issue for this a while ago and already applied a fix to the Trunk for RN 2.3.01. The fix is the same as that posted in this thread so if it is causing problems, I'll have to re-visit it. |
|
|
|
 |
Dawg

|
Posted:
Wed Dec 31, 2008 4:55 pm |
|
Guardian,
If you want access to my site to check it out in the "Wild". I will happily allow it.
When I did it what was posted here....It killed the admin section. I got nothing but a blank page.
Dawg |
|
|
|
 |
Guardian2003

|
Posted:
Wed Dec 31, 2008 5:12 pm |
|
Thats why I need to re-check this. As far as I'm aware I have been using this fix for weeks on my production site and have had no problems so I need to check I actually uploaded the modified file. However, it is 5 past midnight here and let's say the celebrations have gone to my head in more ways than one so my co-ordination is a little out of whack  |
|
|
|
 |
Dawg

|
Posted:
Wed Dec 31, 2008 7:19 pm |
|
Tis all good and HAPPY NEW YEAR!
Dawg |
|
|
|
 |
Guardian2003

|
Posted:
Thu Jan 01, 2009 5:05 am |
|
Yup, this is not the correct fix and does break the admin page. |
|
|
|
 |
Dawg

|
Posted:
Thu Jan 01, 2009 6:58 am |
|
Where is $op set at?
Another clue for you. I have another site that is running on the same code base. It is on a different server. Error reporting set to all. It shows no warnings in the log file and when I echo it out....it is the same as my main one. There is no value.
At least I am not asking about a missing ;
ThankYou for your time!
Dawg |
|
|
|
 |
Palbin

|
Posted:
Thu Jan 01, 2009 11:34 am |
|
$op is usually set in the link that takes you a certain place or the "form" that was submitted to get you there.
That is the best way I can explain it. |
|
|
|
 |
Palbin

|
Posted:
Sat Jan 03, 2009 5:59 pm |
|
|
|
 |
Dawg

|
Posted:
Wed Jul 22, 2009 9:18 pm |
|
Did anyone ever figure this one out?
Dawg |
|
|
|
 |
Guardian2003

|
Posted:
Wed Jul 22, 2009 10:11 pm |
|
I believe it is fixed in the 2.4 release due out next. |
|
|
|
 |
Dawg

|
Posted:
Wed Jul 22, 2009 10:21 pm |
|
Any chance of a fix so I can stop my log files from filling up?
(Does this mean 2.4 is coming soon?)
Dawg |
|
|
|
 |
Guardian2003

|
Posted:
Wed Jul 22, 2009 10:57 pm |
|
There is no seperate fix for that as there are too many changes (renamed variables etc).
Starting the offending line with an ampersand & should suppress the error for now or you can turn your error reporting off or back to the default E_ALL^E_NOTICES
Yes but I cannot give you a date, that's up to the boss man  |
|
|
|
 |
|