News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Undefined index: href Error

Started by nathan89, December 21, 2009, 03:36:09 PM

Previous topic - Next topic

nathan89

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

Arantor

What's on line 472 of index.template.php ?

nathan89

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: }

Arantor

What mods and what theme do you have? Does this happen on the default theme?

nathan89

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   

Arantor

Hmm.

And what version of SMF?

Does it only happen to guests or not?

* The Grinch also wonders idly where Hide Info Center From Guests came from.

nathan89

2.0 RC2  It happens to both guests and members.

I just tried uninstalling Hide Info Center and that didn't corrent the errors.

Arantor

And do any of the buttons on your menu not work as expected?

* The Grinch wonders idly if the mod you have for Hide Info Center is the one he thinks it might be.

nathan89


Arantor

Hmmm. What pages is it occurring on, according to the error log?

nathan89

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 

Arantor

Those are the admin ones.

Does it happen in the main forum too? And if so, is it a different error?

nathan89

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

Arantor

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?

nathan89

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

Arantor

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.

nathan89

That was it. Thank you very much!

Advertisement: