Undefined variable: buttons and main sub template - eval? Help please

Started by tipps, August 20, 2015, 08:20:43 AM

Previous topic - Next topic

tipps

Hello,

I am getting this error in these lines but I can't find the problem, please help?

It's running  SMF 2010

Quote
8: Undefined variable: buttons

/Themes/default/BoardIndex.template.php (main sub template - eval?)
Line: 546 

Quote
8: Undefined variable: buttons

/Themes/default/GenericControls.template.php (main sub template - eval?)
Line: 546

Illori

in the admin panel -> server settings can you disable template eval and post any new errors without eval in them?

tipps

Thank you Illori,

That seemed to fix the default template issue but now I am getting it on my main template.

Quote
8: Undefined variable: buttons

File: /Themes/redsy/index.template.php
Line: 560

Here are the lines it seems to be saying is there is a error in.
// Make the last one, as easy as possible.
$buttons[count($buttons) - 1] = str_replace('<span>', '<span class="last">', $buttons[count($buttons) - 1]);

echo '
<div class="buttonlist', !empty($direction) ? ' float' . $direction : '', '"', (empty($buttons) ? ' style="display: none;"' : ''), (!empty($strip_options['id']) ? ' id="' . $strip_options['id'] . '"': ''), '>
<ul class="nav nav-pills">',
implode('', $buttons), '
</ul>
</div>';


Kindred

Yep, it was almost certainly going to be in that location. There is nothing wrong with that code...   the issue is with the button array -- it looks like a mod was poorly coded and is trying to load buttons when they are not defined.
what mods do you have installed?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

tipps

Hi Kindred,

Thanks for that, I think I just found the issue, some code was missing more than likely caused by me.
So I opened the original file and copied that section of the script to the bottom and I see the missing buttons now.

All the page buttons were missing and I didn't even notice  :-[ and now they are all back.

Thanks for your help guys.

Advertisement: