TinyPortal

Development => Bugs/Errors => Feedback => Fixed Bugs => Topic started by: Nolt on November 12, 2013, 04:54:11 PM

Title: Lot of errors in log with href & title
Post by: Nolt on November 12, 2013, 04:54:11 PM
Link to my forum: http://www.wizzi.pl
SMF version: SMF 2.0.6
TP version: TP 1.0
Default Forum Language: Polish
Theme name and version: Blue-Moon (Gamer Theme modification)
Browser Name and Version: Chrome
Mods installed: screen attached
Related Error messages: screen attached

Well I got lot of errors in mine log, I found what is the reason but I dont know how to fix it. These error shows on any theme when I have this code in Subs.php file.
$buttons = array(
         'home' => array(
            'title' => $txt['home'],
            'href' => $scripturl,
            'show' => true,
            'sub_buttons' => array(
            ),
            'is_last' => $context['right_to_left'],
         ),
      /*   'forum' => array(
            'title' => isset($txt['tp-forum']) ? $txt['tp-forum'] : 'Forum',
            'href' => $scripturl . '?action=forum',
            'show' => true,
         ), */
         'download' => array(
            'title' => $txt['custom_download'],
            'href' => $scripturl . '?action=tpmod;dl',
            'show' => true,
           
            ),

When I uncomment code of forum button logs are clear. BTW when I change show parametr to false (in Forum button code) errors are back again.
Title: Re: Lot of errors in log with href & title
Post by: IchBin on November 12, 2013, 06:03:45 PM
Hey Nolt, good to see you again!

So I'm a bit confused. You are saying when the forum button is NOT commented out that you get no errors? But when you deactivate the button (comment it out) you get errors?

And why do you need to comment out the button? Does it behave the same if you unset() the forum button? You can do this either in the Sources file where the menu array is, or you can do it in the index.template right before it loops over the menu array.

In template you could add this right before it does foreach() on menu array.
unset($context['menu_buttons']['forum']);

Title: Re: Lot of errors in log with href & title
Post by: Nolt on November 13, 2013, 11:07:10 AM
Hi,

I wanna deactivate it because I left behind front page with articles and now (in TP options) site is redirecting directly to the forum index. So at now I got buttons > Home, Forum (now do the same work) Download, Help etc.
I comment part of code just to hide the button but unfortunately lot of errors has been generated in mine logs. If I uncommented "forum" button code and it appears as usually logs was clean.

Besides turning it off with parametr 'show' => false, should do the same thing like comment but errors are genereted. I thought its maybe a theme bug so I chagned to another one, but still errors are present.


EDIT:
I just tried with clean SMF+TP install and with code in Subs.php (default SMF+TP options)
'forum' => array(
'title' => isset($txt['tp-forum']) ? $txt['tp-forum'] : 'Forum',
'href' => $scripturl . '?action=forum',
'show' => false,  // I changed this only
),

Logs are generating same errors Undefined index: title or Undefined index: title.
Title: Re: Lot of errors in log with href & title
Post by: IchBin on November 14, 2013, 07:03:24 PM
I haven't had the time to test this out for you sorry. But did you try the unset() option instead of commenting code out?
Title: Re: Lot of errors in log with href & title
Post by: Nolt on November 14, 2013, 07:45:54 PM
Not yet, I will give a try and update this message. But I think it will work only for theme which I use now, unfortunately this error shows on all installed themes.
Title: Re: Lot of errors in log with href & title
Post by: IchBin on November 15, 2013, 02:43:19 AM
Then you can put the unset() right after the array is created in the Sources file.
Title: Re: Lot of errors in log with href & title
Post by: Nolt on November 26, 2013, 12:01:45 PM
Seems it doesnt work or I put it in wrong place.
Title: Re: Lot of errors in log with href & title
Post by: DeVIL-I386 on November 26, 2013, 10:12:12 PM
You can hide this entry if you

li#button_forum {
visibility:hidden !important;
display:none !important;
}


adding in your "./Themes/Blue-Moon/css/index.css".

EDIT: Sorry. I just see that you are doing to the error log.
Title: Re: Lot of errors in log with href & title
Post by: IchBin on November 27, 2013, 05:35:54 AM
Ok, finally had some time to debug. :D

You need to comment out or remove this code in Subs.php:
elseif (isset($_GET['board']) || isset($_GET['topic']))
      $current_action = 'forum';
Title: Re: Lot of errors in log with href & title
Post by: Nolt on November 28, 2013, 11:59:56 AM
 O0
Thank you very much, work like a charm.