Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: nathan89 on December 21, 2009, 03:36:09 PM

Title: Undefined index: href Error
Post by: nathan89 on December 21, 2009, 03:36:09 PM
I am getting the following error after installing this theme.  What would I need to do to resolve it?

Undefined index: href
File: index.template.php
Line: 472
Title: Re: Undefined index: href Error
Post by: Arantor on December 21, 2009, 03:43:40 PM
What's on line 472 of index.template.php ?
Title: Re: Undefined index: href Error
Post by: nathan89 on December 21, 2009, 03:51:55 PM
460: function template_menu()
461: {
462: global $context, $settings, $options, $scripturl, $txt;
463: 
464: echo '
465: <div id="horiz-menu">
466: <ul class="topnav" style="overflow: visible; float: left;">';
467: 
468: foreach ($context['menu_buttons'] as $act => $button)
469: {
470: echo '
471: <li' , $button['active_button'] ? ' class="active"' : '' , '>
==>472: <a href="', $button['href'], '">' , $button['title'], '</a>';
473:
474: // any subbuttons then?
475: if(!empty($button['sub_buttons']))
476: {
477: echo '<ul style="overflow: hidden; visibility: visible; opacity: 1;">';
478: foreach ($button['sub_buttons'] as $subact => $sbutton)
479: echo '
480: <li>
481: <a href="', $sbutton['href'], '">' , $sbutton['title'], '</a>
482: </li>';
483: echo '
484: </ul>';
485: }
486: echo '
487: </li>';
488: }
489: 
490: echo '
491: </ul>';
492: }
Title: Re: Undefined index: href Error
Post by: Arantor on December 21, 2009, 03:55:48 PM
What mods and what theme do you have? Does this happen on the default theme?
Title: Re: Undefined index: href Error
Post by: nathan89 on December 21, 2009, 04:10:40 PM
My theme is Urban, it also happens on the default theme.  I have the current mods installed:

1. More Spiders 1.2   
2. Meta-Tags 1.2     
3. Hide Info Center From Guests 1.0   
4. SMF Media Gallery 2.0.5   
5. PM to New Members 1.2   
6. RSS Feeder 1.1.4   
7. DisableTemplateEval 1.2 
8. SMF Staff Page 1.6 
9. Aeva ~ Auto-Embed Video & Audio 7.0     
10. Sitemap 2.1.0   
11. SimplePortal 2.3.1   
12. Treasury 2.02   
Title: Re: Undefined index: href Error
Post by: Arantor on December 21, 2009, 04:12:45 PM
Hmm.

And what version of SMF?

Does it only happen to guests or not?

/me also wonders idly where Hide Info Center From Guests came from.
Title: Re: Undefined index: href Error
Post by: nathan89 on December 21, 2009, 04:14:57 PM
2.0 RC2  It happens to both guests and members.

I just tried uninstalling Hide Info Center and that didn't corrent the errors.
Title: Re: Undefined index: href Error
Post by: Arantor on December 21, 2009, 04:17:37 PM
And do any of the buttons on your menu not work as expected?

/me wonders idly if the mod you have for Hide Info Center is the one he thinks it might be.
Title: Re: Undefined index: href Error
Post by: nathan89 on December 21, 2009, 04:18:50 PM
Nope, they all seem to work fine.
Title: Re: Undefined index: href Error
Post by: Arantor on December 21, 2009, 04:20:22 PM
Hmmm. What pages is it occurring on, according to the error log?
Title: Re: Undefined index: href Error
Post by: nathan89 on December 21, 2009, 04:25:27 PM
It looks like the error occurs on just about every page.  I turned template eval back on. Here are what the errors change to:


    Today at 04:23:41 PM
1c6e76b9a0d87f50b9ea5f90319959d6
Type of error: Undefined 
http://crohnssociety.org/community/index.php?action=admin;area=serversettings;sa=general;f10b4194120=1c6e76b9a0d87f50b9ea5f90319959d68: Undefined index: hrefFile: /home/nathan/crohnssociety/community/cache/lang_ManageSettings_english_default.php (body_above sub template - eval?)
Line: 522 

    Today at 04:22:57 PM
1c6e76b9a0d87f50b9ea5f90319959d6
Type of error: Undefined 
http://crohnssociety.org/community/index.php?action=admin;area=logs;f10b4194120=1c6e76b9a0d87f50b9ea5f90319959d68: Undefined index: hrefFile: /home/nathan/crohnssociety/community/Themes/default/index.template.php
Line: 522 
Title: Re: Undefined index: href Error
Post by: Arantor on December 21, 2009, 04:27:30 PM
Those are the admin ones.

Does it happen in the main forum too? And if so, is it a different error?
Title: Re: Undefined index: href Error
Post by: nathan89 on December 21, 2009, 04:29:53 PM
Yes it happens in the main forum too. Same errors.

http://crohnssociety.org/community/index.php?action=admin;area=logs;f10b4194120=1c6e76b9a0d87f50b9ea5f90319959d68: Undefined index: hrefFile: /home/nathan/crohnssociety/community/Themes/default/Errors.template.php (body_above sub template - eval?)
Line: 522
Title: Re: Undefined index: href Error
Post by: Arantor on December 21, 2009, 04:30:50 PM
No, that's not the main forum. That log seems to imply it's still in the admin area.

Do you have any errors with entries that don't have ?action=admin in them?
Title: Re: Undefined index: href Error
Post by: nathan89 on December 21, 2009, 04:33:34 PM
Sorry, copied the wrong one.

http://crohnssociety.org/community/index.php?board=2.08: Undefined index: hrefFile: /home/nathan/crohnssociety/community/Themes/default/MessageIndex.template.php (body_above sub template - eval?)
Line: 522
Title: Re: Undefined index: href Error
Post by: Arantor on December 21, 2009, 04:36:09 PM
Figured it out.

It's in your menu, specifically the entry for 'Living' - the top level menu (where it actually says 'Living') is supposed to have a link somewhere, but 'href' wasn't defined for that item, which is what the error is complaining about.

Add 'href' => '#' if you don't want it to go anywhere, or a 'href' => 'url' item if you do.
Title: Re: Undefined index: href Error
Post by: nathan89 on December 21, 2009, 04:44:42 PM
That was it. Thank you very much!