PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
Palbin
Site Admin


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

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

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
Site Admin


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

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

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


Joined: Aug 30, 2005
Posts: 3186
Location: near Albany NY

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

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
Site Admin


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

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

I seem to get it everywhere other than when in your_account. In home, forums, survey, stats, etc......
View user's profile Send private message
Palbin
Site Admin


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

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

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


Joined: Aug 30, 2005
Posts: 3186
Location: near Albany NY

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

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


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

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

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


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

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

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


Joined: Aug 30, 2005
Posts: 3186
Location: near Albany NY

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

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


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

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

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.
View user's profile Send private message
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

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

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
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

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

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

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

Dave
View user's profile Send private message
fkelly
Moderator


Joined: Aug 30, 2005
Posts: 3186
Location: near Albany NY

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

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


Joined: Aug 28, 2003
Posts: 6373
Location: Vsetin, Czech Republic

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

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 Visit poster's website
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

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

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


Joined: Aug 28, 2003
Posts: 6373
Location: Vsetin, Czech Republic

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

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
View user's profile Send private message Send e-mail Visit poster's website
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

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

Tis all good and HAPPY NEW YEAR!

Dawg
View user's profile Send private message
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6373
Location: Vsetin, Czech Republic

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

Yup, this is not the correct fix and does break the admin page.
View user's profile Send private message Send e-mail Visit poster's website
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

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

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


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

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

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


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

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

Dawg, remove that fix because as you said when you go to your admin it is blank.
Only registered users can see links on this board!
Get registered or login to the forums!


This should work though.
Only registered users can see links on this board!
Get registered or login to the forums!


We are currently working on the issue.
View user's profile Send private message
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

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

Did anyone ever figure this one out?

Dawg
View user's profile Send private message
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6373
Location: Vsetin, Czech Republic

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

I believe it is fixed in the 2.4 release due out next.
View user's profile Send private message Send e-mail Visit poster's website
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

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

Any chance of a fix so I can stop my log files from filling up?

(Does this mean 2.4 is coming soon?)

Dawg
View user's profile Send private message
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6373
Location: Vsetin, Czech Republic

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

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum