Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: KittyGalore on September 24, 2021, 01:13:12 PM

Title: Possible bug viewing the warning log
Post by: KittyGalore on September 24, 2021, 01:13:12 PM
SMF V 2.0.18

This looks to be a bug i saw this on my main forum when i would go into the warning log to see the list of warning issued to members at first i thought it was a mod but i created a brand new test forum new files new database no mods no posts i issued another test account with a warning and then went to the warning log to view the warnings. 

These errors comes up in the error log.

(https://i.gyazo.com/b92fe4fc12d51565ecafa9fddec2e8f0.png)

Also here is the warning i'm also curious about what is this blank image this was what started me to investigate it the first time because i was 100 percent sure it was a mod that was doing it but it's still the same on a brand new test forum the image and the errors in the error log.

(https://i.gyazo.com/c4136673e4908bede159b8976c477555.png)
Title: Re: Possible bug viewing the warning log
Post by: shawnb61 on September 24, 2021, 01:32:43 PM
What version of php are you running?
Title: Re: Possible bug viewing the warning log
Post by: KittyGalore on September 24, 2021, 02:32:03 PM
Quote from: shawnb61 on September 24, 2021, 01:32:43 PMWhat version of php are you running?
I'm currently using 7.4 but i have tried them all i would change to 7.3 then look in the log and it would throw the error.
Title: Re: Possible bug viewing the warning log
Post by: shawnb61 on September 24, 2021, 02:51:28 PM
7.4 is fine.  I thought you might have been running 8.

I cannot reproduce this...  I suspect the errors & the broken image link are related.
Title: Re: Possible bug viewing the warning log
Post by: Shambles on September 24, 2021, 03:00:18 PM
I CAN reproduce this.

Code ("Select from ModerationCentre.php") Select
            'reason' => array(
                'header' => array(
                    'value' => $txt['profile_warning_previous_reason'],
                ),
                'data' => array(
                    'function' => function($rowData) use ($scripturl, $txt, $settings)
                    {

Code ("Replace with") Select
            'reason' => array(
                'header' => array(
                    'value' => $txt['profile_warning_previous_reason'],
                ),
                'data' => array(
                    'function' => function($rowData)
                    {
                        global $scripturl, $txt, $settings;
Title: Re: Possible bug viewing the warning log
Post by: KittyGalore on September 24, 2021, 03:05:23 PM
Quote from: shawnb61 on September 24, 2021, 02:51:28 PM7.4 is fine.  I thought you might have been running 8.

I cannot reproduce this...  I suspect the errors & the broken image link are related.
I actually did double check and 7.4 is the only one that throws the second error  Trying to access array offset on value of type null
The others 7.3 and 7.2 and 7.1 only throws the one error  Undefined variable: settings
Title: Re: Possible bug viewing the warning log
Post by: KittyGalore on September 24, 2021, 03:06:12 PM
Quote from: Shambles on September 24, 2021, 03:00:18 PMI CAN reproduce this.

Code ("Select from ModerationCentre.php") Select
            'reason' => array(
                'header' => array(
                    'value' => $txt['profile_warning_previous_reason'],
                ),
                'data' => array(
                    'function' => function($rowData) use ($scripturl, $txt, $settings)
                    {

Code ("Replace with") Select
            'reason' => array(
                'header' => array(
                    'value' => $txt['profile_warning_previous_reason'],
                ),
                'data' => array(
                    'function' => function($rowData)
                    {
                        global $scripturl, $txt, $settings;

Thanks i will try this.
Title: Re: Possible bug viewing the warning log
Post by: KittyGalore on September 24, 2021, 03:13:36 PM
Yes thank you @Shambles that code has fixed the errors and the image. Now i must remember if i'm updating or installing a mod and it throws a error to change the code back. :)
Title: Re: Possible bug viewing the warning log
Post by: KittyGalore on September 24, 2021, 03:15:07 PM
I'm marking solved for now if anyone thinks it's a bug then they can actually confirm it.
Title: Re: Possible bug viewing the warning log
Post by: Shambles on September 24, 2021, 03:21:52 PM
Quote from: KittyGalore on September 24, 2021, 03:15:07 PMI'm marking solved for now if anyone thinks it's a bug then they can actually confirm it.
Well, if it fails in the way described in a raw 2.0.18 installation and, presumably, in a ->2.0.18 upgrade, then it's a bug.

The function being defined assumes that it's being called with the globalised items available on the stack frame, when in practise they not be available to stack at the time of invocation; hence the (use) will point to one or more null addresses; this is fixed by extending the globalising.
Title: Re: Possible bug viewing the warning log
Post by: KittyGalore on September 24, 2021, 03:24:22 PM
Quote from: Shambles on September 24, 2021, 03:21:52 PM
Quote from: KittyGalore on September 24, 2021, 03:15:07 PMI'm marking solved for now if anyone thinks it's a bug then they can actually confirm it.
Well, if it fails in the way described in a raw 2.0.18 installation and, presumably, in a ->2.0.18 upgrade, then it's a bug.

The function being defined assumes that it's being called with the globalised items available on the stack frame, when in practise they not be available to stack at the time of invocation; hence the (use) will point to one or more null addresses; this is fixed by extending the globalising.
Ok thank you. :)