News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Unknown Tab

Started by TheListener, January 06, 2011, 03:52:14 PM

Previous topic - Next topic

TheListener

I have recently discoverd an unknown tab which appears every time I install a mod.

In the error log recently the following appears.

   

// Print out all the items in this tab.
303:    
foreach ($tab_context['tabs'] as $sa => $tab)
304:    
{
305:    
if (!empty($tab['disabled']))
306:    
continue;
307:     blank line
308:    
if (!empty($tab['is_selected']))
309:    
{
310:    
echo '
311:    
<li>
312:    
<a class="active firstlevel" href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '"><span class="firstlevel">', $tab['label'], '</span></a>
313:    
</li>';
314:    
}
315:    
else
316:    
echo '
317:    
<li>
==>318:    
<a class="firstlevel" href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '"><span class="firstlevel">', $tab['label'], '</span></a>
319:    

</li>';
320:    
}
321:    
322:    
// the end of tabs


Attachement included.


kat

Mod not showing?

If you use the default theme, is anything showing, there?

TheListener

Good thought there Kat.

Still the same though.

kat

Looks like a mod that's not installed, properly, to me.

Did you add any, before this started happening?

Probably a "Security" one?

TheListener

Only one which doesn't even add a tab.

Illori

can you post exactly what the error log says? what you posted in the first post does not look like output from the error log.

Arantor

@Illori: if you get an error, you can click on the magnifying glass to spotlight the code that's causing the error.

Well, the code you've highlighted is the menu display code, not the menu definition code. Looking there won't help you in the slightest.

Please attach your Sources/ManageSettings.php file.

Illori

#7
well they did not post the error message, which could help to figure out what the issue is.

[edit] I dont see how clicking the magnifying glass does that, when you hover over the glass, it tells you it applies a filter with that option not showing more details on the error message.

Arantor

Or not in this case. The error message would have been an undefined index label in either GenericMenu.template.php or Admin.template.php depending on whether eval was on or not, likely it would flag up GenericMenu. Either way, doesn't really matter, the root cause is that there is an array index being defined in ManageSettings.php that shouldn't be. (Or, very possibly, Admin.php, but we'll look at ManageSettings.php first)

TheListener

IM was right the file flagged was the Generic Menu Template.

Arantor

Offending code misbehaving in that file:

$context[$context['admin_menu_name']]['tab_data'] = array(
'title' => $txt['admin_security_moderation'],
'help' => 'securitysettings',
'description' => $txt['security_settings_desc'],
'tabs' => array(
'general' => array(
),

'custom_mp3' => array(
),
'spam' => array(
'description' => $txt['antispam_Settings_desc'] ,
),
'moderation' => array(
),
),
);


Note the extra 'custom_mp3' entry. I'm guessing it's a mod that wasn't supposed to install there but since it's a file that contains a lot of very similar entries...

Rewrite it to the following:

$context[$context['admin_menu_name']]['tab_data'] = array(
'title' => $txt['admin_security_moderation'],
'help' => 'securitysettings',
'description' => $txt['security_settings_desc'],
'tabs' => array(
'general' => array(
),
'spam' => array(
'description' => $txt['antispam_Settings_desc'] ,
),
'moderation' => array(
),
),
);



That's one of the troubles of an MVC architecture, though, an error in output is often not actually an error in the output but in the setup earlier on.

Still, that will fix it.

-- Arantor

(Less of a bad mood for you? :P)

TheListener

Woohoo

That fixed it.

Much obliged.

:D

Advertisement: