MyBB Community Forums

Full Version: 1.8.38 Editpost and Newreply warnings
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
On 1.8.38, Edit post produces this warning:
<error>
    <dateline>1744063939</dateline>
    <script>editpost.php(986) : eval()'d code</script>
    <line>26</line>
    <type>2</type>
    <friendly_type>Warning</friendly_type>
    <message>Undefined variable $posticons</message>
    <back_trace>#0  errorHandler->error() called at [/inc/class_error.php:153]
#1  errorHandler->error_callback() called at [/editpost.php(986) : eval()'d code:26]
#2  eval() called at [/editpost.php:986]
</back_trace>
</error> 

And New Reply Produces this warning:
<error>
    <dateline>1744212197</dateline>
    <script>newreply.php(1517) : eval()'d code</script>
    <line>29</line>
    <type>2</type>
    <friendly_type>Warning</friendly_type>
    <message>Undefined variable $posticons</message>
    <back_trace>#0  errorHandler->error() called at [/inc/class_error.php:153]
#1  errorHandler->error_callback() called at [/newreply.php(1517) : eval()'d code:29]
#2  eval() called at [/newreply.php:1517]
</back_trace>
</error> 

Some background here.
Pushed.
https://github.com/mybb/mybb/issues/4888

Thanks for improving MyBB.
Could you please explain how to reproduce these? I'm unable to reproduce the errors in both editpost and newreply (with post icons, custom post icons,...).
This depends on the forum rights

If the use of posticons is not permitted in a forum, the $posticons variable is not set, which leads to a warning.

See for example the newreply.php line 925-928
 if($forum['allowpicons'] != 0)
  {
  $posticons = get_post_icons();
  }

In my opinion, however, it is more important to avoid these warnings occurring in special cases than to recreate them
Use the fix effone linked and it will never occure
Thanks.
Pushed a PR with the fixes (editpost, newreply and newthread).
(2025-04-17, 11:49 AM)bv64 Wrote: [ -> ]This depends on the forum rights

Thanks for finding that setting! I must have set that around 2014, so it would have taken me awhile to find it again.
@Dave H yep, it's well hidden, I also dug a bit