Author Topic: Tag System Error  (Read 1005 times)

Offline pj

  • Learning.
  • Technical Guild
  • Evaluator
  • *****
  • Posts: 14179
  • We are made of such stuff as dreams are made of.
Tag System Error
« on: January 26, 2010, 10:02:01 PM »
We're throwing a new PHP error, as reported by StarSeeker.  Here's the log:

http://mortalmist.com/forum/index.php?action=tags

8: Undefined index: u
File: /var/www/html/forum/Sources/Tags.php
Line: 170

He said the error happened when he accessed it from within somebody's journal - so it looks like the context is supposed to be setting a variable used as an index and it isn't happening or is getting screwed up.  Just a guess so far - haven't dug into it any further yet.
What truly matters is not built of right and wrong; but of grace, and of love.

--pj

Offline Raklet

  • Technical Guild
  • Evaluator
  • *****
  • Posts: 1129
Re: Tag System Error
« Reply #1 on: January 26, 2010, 10:37:14 PM »
We're throwing a new PHP error, as reported by StarSeeker.  Here's the log:

http://mortalmist.com/forum/index.php?action=tags

8: Undefined index: u

Every little green tag under a user's quick profile (to the left of every post) should show something like this:

http://mortalmist.com/forum/index.php?action=tags;whichTag=otags;u=1

The 'u' stands for the user id so the tag system can know which set of user tags to pull up.  Some link was called with 'u=' in it but no number was defined.  That is what the undefined index message means: some variable was called but had an undefined value.  I've never seen a user id that was not defined (as a user can't exist without an ID) so I have no idea how to even track down that problem.  I would need to know which journal and which user tag StarSeeker tried to click on.
File: /var/www/html/forum/Sources/Tags.php
Line: 170

He said the error happened when he accessed it from within somebody's journal - so it looks like the context is supposed to be setting a variable used as an index and it isn't happening or is getting screwed up.  Just a guess so far - haven't dug into it any further yet.

Offline pj

  • Learning.
  • Technical Guild
  • Evaluator
  • *****
  • Posts: 14179
  • We are made of such stuff as dreams are made of.
Re: Tag System Error
« Reply #2 on: January 26, 2010, 10:40:50 PM »
Yeah - and I haven't been able to duplicate it with the reported link.

Just got back from trying to find where it was reported.  It may not have been StarSeeker.  Can't find it yet.
What truly matters is not built of right and wrong; but of grace, and of love.

--pj

Offline pj

  • Learning.
  • Technical Guild
  • Evaluator
  • *****
  • Posts: 14179
  • We are made of such stuff as dreams are made of.
Re: Tag System Error
« Reply #3 on: January 26, 2010, 10:48:40 PM »
I just PM'd him.  He's in Portugal, so he'll not likely be reporting back to us for a while.

And I'm off to bed.  Enough fun for one day!

Thanks for everything.
What truly matters is not built of right and wrong; but of grace, and of love.

--pj

Offline mu

  • Ishmael
  • Technical Guild
  • Evaluator
  • *****
  • Posts: 4584
Re: Tag System Error
« Reply #4 on: January 27, 2010, 05:14:03 AM »
I've reproduced it.  StarSeeker has a Member's only DJ..  If you have two browser windows open, one in his DJ, and use the other one to logout, then click the link in his DJ..

That's all I know right now..  For all I know I'm still asleep..

Offline pj

  • Learning.
  • Technical Guild
  • Evaluator
  • *****
  • Posts: 14179
  • We are made of such stuff as dreams are made of.
Re: Tag System Error
« Reply #5 on: January 27, 2010, 07:18:23 PM »
I've reproduced it as well, and I see that Raklet has too.

Here's the trap that's being tripped:

if (!is_numeric($_REQUEST['u']))
            fatal_error('Tsk, tsk, shame on you hacker.', false);

Might this be because the Members Only journal is no longer a subforum?
What truly matters is not built of right and wrong; but of grace, and of love.

--pj

Offline Raklet

  • Technical Guild
  • Evaluator
  • *****
  • Posts: 1129
Re: Tag System Error
« Reply #6 on: January 27, 2010, 08:33:02 PM »
I've reproduced it.  StarSeeker has a Member's only DJ..  If you have two browser windows open, one in his DJ, and use the other one to logout, then click the link in his DJ..

That's all I know right now..  For all I know I'm still asleep..

Hmmm, I can't get that to produce an error.  It just takes me to the tags page and shows all of the personal tags for Starseeker.  They way I trip it is

main nav bar
tags
choose "Other members tags" from the drop down
click go

There is the error.  The reason why is the drop down is requesting other members, but it can only request ONE member at a time and it does not know which member is being requested.  'u' is undefined and thus it throws an error.  This is a leftover remnant that I am going to remove.  I think I was originally going to provide a list of members when that option was selected in the drop down, but I never implemented it after I chose to move the "other members tags" feature to the little green tag provided under each user's quick profile.

Offline pj

  • Learning.
  • Technical Guild
  • Evaluator
  • *****
  • Posts: 14179
  • We are made of such stuff as dreams are made of.
Re: Tag System Error
« Reply #7 on: January 27, 2010, 09:16:04 PM »
Sounds like the simple solution!

Thank you.
What truly matters is not built of right and wrong; but of grace, and of love.

--pj

Offline mu

  • Ishmael
  • Technical Guild
  • Evaluator
  • *****
  • Posts: 4584
Re: Tag System Error
« Reply #8 on: January 28, 2010, 12:22:44 AM »
Is this solved then?

Offline pj

  • Learning.
  • Technical Guild
  • Evaluator
  • *****
  • Posts: 14179
  • We are made of such stuff as dreams are made of.
Re: Tag System Error
« Reply #9 on: January 28, 2010, 10:19:40 AM »
Not yet - can still get the error.

If I understand correctly, Raklet is going to remove the offending feature.  Sounds like it was never fully implemented anyway.
What truly matters is not built of right and wrong; but of grace, and of love.

--pj

Offline Raklet

  • Technical Guild
  • Evaluator
  • *****
  • Posts: 1129
Re: Tag System Error
« Reply #10 on: January 28, 2010, 10:39:56 AM »
I have removed the offending feature.  If you can still reproduce the error by other means, please let me know.

Here is one way that you can intentionally do it, and it is exactly what the program was designed to prevent:


http://mortalmist.com/forum/index.php?action=tags;whichTag=otags;u=

or

http://mortalmist.com/forum/index.php?action=tags;whichTag=otags;u='drop * from mortalmist';

or any such thing where 'u' is not a number.

The point is, the error exists for a reason, but should only occur through direct manipulation.  Normal system use (just clicking on links provided) should not produce the error.  If you can find errors that occur through normal use, that it what I am interested in.

Offline pj

  • Learning.
  • Technical Guild
  • Evaluator
  • *****
  • Posts: 14179
  • We are made of such stuff as dreams are made of.
Re: Tag System Error
« Reply #11 on: January 28, 2010, 10:47:10 AM »
The option in the drop-down is gone, so yeah - unless somebody is playing directlywith the post URL it should be settled.

Thanks again, Raklet.
What truly matters is not built of right and wrong; but of grace, and of love.

--pj