News:

Join the Facebook Fan Page.

Main Menu

undefined index

Started by emanuele, January 27, 2012, 12:45:42 PM

Previous topic - Next topic

emanuele

Not sure if it can be considered a bug or not, but accessing:
$boardurl . '/index.php?action=login2;sa=check;member={randomnumber}'
two "undefined index" errors are logged:
1) 8: Undefined index: title
File: /Themes/default/Errors.template.php (body_above sub template - eval?)
Line: 422

2) 8: Undefined index: href
File: /Themes/default/Errors.template.php (body_above sub template - eval?)
Line: 421


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Kays

#1
It could be. I have seen these errors reported before. Not quite sure of the circumstances behind the other reports though.

Calling that directly I can reproduce the error. At that point the user is logged in and the menu adds an empty item for the login button at the end of the button array for some reason.


home - Home - http://localhost/test2/index.php
help - Help - http://localhost/test2/index.php?action=help
search - Search - http://localhost/test2/index.php?action=search
admin - Admin - http://localhost/test2/index.php?action=admin
moderate - Moderate - http://localhost/test2/index.php?action=moderate
profile - Profile - http://localhost/test2/index.php?action=profile
pm - My Messages - http://localhost/test2/index.php?action=pm
calendar - Calendar - http://localhost/test2/index.php?action=calendar
mlist - Members - http://localhost/test2/index.php?action=mlist
logout - Logout - http://localhost/test2/index.php?action=logout;a8bdf6ec5c0=83779c4dd1ba6945060d5c1670c6aa11
login - -



Edit - Found the culprit. :)

In Subs.php look for:


$context['menu_buttons'][$current_action]['active_button'] = true;


And change it to:


if (isset($context['menu_buttons'][$current_action]))
$context['menu_buttons'][$current_action]['active_button'] = true;



Since the current action is login and the button don't exist. It will add an empty active button at the end of the array. Could be the cause of the other occurrences of this error I've noticed.

Gotta find an old thread where the OP was willing to work with me on this to confirm.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

emanuele



Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

hcfwesker

#3
Quote from: Kays on January 27, 2012, 11:36:52 PM
It could be. I have seen these errors reported before. Not quite sure of the circumstances behind the other reports though.

I'm one of the ones who have reported this.  Most common instances I see the errors are on the search page, when a member searches, then puts in another search which becomes search=2 , and the errors appear.

http://www.simplemachines.org/community/index.php?topic=420233.msg2938158#msg2938158

Also, when members are viewing membergroups in the group legend  linked on board index in the info center.

This was another support topic I tracked hoping for a fix.  http://www.simplemachines.org/community/index.php?topic=438007.msg3075724#msg3075724

My own solution was to remove this ( i know its not the right fix, but only thing i could do to stop the 100s of errors a day being made.

index.template.php
<ul>';

foreach ($childbutton['sub_buttons'] as $grandchildbutton)
echo '
<li>
<a href="', $grandchildbutton['href'], '"', isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '>
<span', isset($grandchildbutton['is_last']) ? ' class="last"' : '', '>', $grandchildbutton['title'], '</span>
</a>
</li>';

echo '

Kays

No problem. I've seen that error more than a few times and it was nice to finally be able to replicate it. :)

I did find that thread and the OP had moved the Profile button. Which resulted in the same error just for a different button this time. Basically that error will occur any time there's a $_GET['action'] and no corresponding button.

So I guess it can be considered to be a bug. :)

@hcfwesker

I think that both topics could be related to this. For the second, members report the buttons disappearing at times.

But for the first link, that scenario should covered. Unless the search button is missing.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Joshua Dickerson

Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

Suki

just posting here so I can find it later, I was actually having this issue too, my solution was similar but it involved a rather nasty hack (lots of foreach statements), this one looks much better :)
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Spuds

Should be tracked ... it was also fixed in Commit:c5553d049f7288c3bc72af3737bd9c1b0ecc7bc3 in git:development

emanuele



Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Masterd

I had this problem only with RC3. It never happened to me agaian.

Chas Large

I too had lots of Undefined errors appearing just as hfcwecker reported and found that the edit suggested by Kays here fixed it.

Thanks Kays.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Advertisement: