Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Issues
Author Message
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Mon Nov 10, 2008 6:46 pm Reply with quote

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
 
View user's profile Send private message
Palbin







PostPosted: Mon Nov 10, 2008 6:51 pm Reply with quote

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

PostPosted: Mon Nov 10, 2008 6:59 pm Reply with quote

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.
 
View user's profile Send private message Visit poster's website
Palbin







PostPosted: Mon Nov 10, 2008 7:19 pm Reply with quote

I seem to get it everywhere other than when in your_account. In home, forums, survey, stats, etc......
 
Palbin







PostPosted: Mon Nov 10, 2008 7:25 pm Reply with quote

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







PostPosted: Mon Nov 10, 2008 7:31 pm Reply with quote

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







PostPosted: Mon Nov 10, 2008 7:37 pm Reply with quote

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







PostPosted: Mon Nov 10, 2008 7:44 pm Reply with quote

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







PostPosted: Tue Nov 11, 2008 8:35 am Reply with quote

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







PostPosted: Tue Nov 11, 2008 9:28 am Reply with quote

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

PostPosted: Wed Dec 31, 2008 7:46 am Reply with quote

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();
      }
 
View user's profile Send private message
Dawg







PostPosted: Wed Dec 31, 2008 8:04 am Reply with quote

Ya that broke something....No Admin panel.

Hmmm...will have to try again...

Dave
 
fkelly







PostPosted: Wed Dec 31, 2008 8:27 am Reply with quote

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

PostPosted: Wed Dec 31, 2008 4:40 pm Reply with quote

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.
 
View user's profile Send private message Send e-mail
Dawg







PostPosted: Wed Dec 31, 2008 4:55 pm Reply with quote

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







PostPosted: Wed Dec 31, 2008 5:12 pm Reply with quote

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 Wink
 
Dawg







PostPosted: Wed Dec 31, 2008 7:19 pm Reply with quote

Tis all good and HAPPY NEW YEAR!

Dawg
 
Guardian2003







PostPosted: Thu Jan 01, 2009 5:05 am Reply with quote

Yup, this is not the correct fix and does break the admin page.
 
Dawg







PostPosted: Thu Jan 01, 2009 6:58 am Reply with quote

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!

Smile

Dawg
 
Palbin







PostPosted: Thu Jan 01, 2009 11:34 am Reply with quote

$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







PostPosted: Sat Jan 03, 2009 5:59 pm Reply with quote

Dawg, remove that fix because as you said when you go to your admin it is blank.
www.mysite.com/admin.php

This should work though.
www.mysite.com/admin.php?op=adminMain

We are currently working on the issue.
 
Dawg







PostPosted: Wed Jul 22, 2009 9:18 pm Reply with quote

Did anyone ever figure this one out?

Dawg
 
Guardian2003







PostPosted: Wed Jul 22, 2009 10:11 pm Reply with quote

I believe it is fixed in the 2.4 release due out next.
 
Dawg







PostPosted: Wed Jul 22, 2009 10:21 pm Reply with quote

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







PostPosted: Wed Jul 22, 2009 10:57 pm Reply with quote

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 Wink
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©