Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: Grammy on July 18, 2022, 02:00:34 PM

Title: Error being thrown, GenericMenu template
Post by: Grammy on July 18, 2022, 02:00:34 PM
2.1.2, Default.  The error is Undefined array key "label" and the line is 121, GenericMenu.template.php



<a ', !empty($sub['selected']) ? 'class="chosen" ' : '', ' href="', $url, $menu_context['extra_parameters'], '">', $sub['label'], !empty($sub['amt']) ? ' <span class="amt">' . $sub['amt'] . '</span>' : '', '</a>

It seems to happen when the user is modifying his account.

I couldn't find anything about it here, using the search feature. 
Title: Re: Error being thrown, GenericMenu template
Post by: Arantor on July 18, 2022, 02:03:08 PM
You have a mod with a bug, that is trying to add an item to the profile menu but not doing it properly.

You could replace that line of code with:


<a ', !empty($sub['selected']) ? 'class="chosen" ' : '', ' href="', $url, $menu_context['extra_parameters'], '">', isset($sub['label']) ? $sub['label'] : 'MISSING TEXT', !empty($sub['amt']) ? ' <span class="amt">' . $sub['amt'] . '</span>' : '', '</a>

This would prevent the errors and you'd see which item had MISSING TEXT as its text in the menu so you could start narrowing down what caused it.
Title: Re: Error being thrown, GenericMenu template
Post by: Grammy on July 18, 2022, 02:11:24 PM
Quote from: Arantor on July 18, 2022, 02:03:08 PMYou have a mod with a bug, that is trying to add an item to the profile menu but not doing it properly.

You could replace that line of code with:


<a ', !empty($sub['selected']) ? 'class="chosen" ' : '', ' href="', $url, $menu_context['extra_parameters'], '">', isset($sub['label']) ? $sub['label'] : 'MISSING TEXT', !empty($sub['amt']) ? ' <span class="amt">' . $sub['amt'] . '</span>' : '', '</a>

This would prevent the errors and you'd see which item had MISSING TEXT as its text in the menu so you could start narrowing down what caused it.

Thanks so much, Arantor!  I'm on it.   :)