MyBB Community Forums

Full Version: Showteam warning on clean install
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
<error>
<dateline>1676380774</dateline>
<script>showteam.php</script>
<line>192</line>
<type>2</type>
<friendly_type>Warning</friendly_type>
<message>Undefined array key 2</message>
<back_trace>#0 errorHandler->error() called at [/inc/class_error.php:153]
#1 errorHandler->error_callback() called at [/showteam.php:192]
</back_trace>
</error>

On new install 1833, PHP 8, no plugins, default Settings.

To replicate:
Create a User and activate, set Primary Usergroup is "Registered", Additional Usergroup is "Moderator", Display User Group is "Use Primary User Group".
Click on Showteam.
You couldtry this:

change in showteam.php line #192 from
if($usergroups[$group] && $group != 6)

into
if(isset($usergroups[$group]) && $group != 6)
That has fixed it. Warning no longer shows, and Show Team works as expected.
Your answer also helped me understand better the difference between !empty and isset.
Thanks.
You're welcome!

But this is still an existing issues on forum software and should be fixed in one of next updates.
Yes, I rely on more experienced people to evaluate the nuance of a fix on the larger system.