• Welcome to Simple Machines Community Forum. Please login or sign up.
December 06, 2021, 05:59:25 AM

News:

Want to get involved in developing SMF, then why not lend a hand on our github!


Possible bug viewing the warning log

Started by KittyGalore, September 24, 2021, 01:13:12 PM

Previous topic - Next topic

KittyGalore

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.



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.

SMF Curve 2.0x

shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

KittyGalore

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.
SMF Curve 2.0x

shawnb61

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.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Shambles

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;

KittyGalore

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
SMF Curve 2.0x

KittyGalore

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.
SMF Curve 2.0x

KittyGalore

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. :)
SMF Curve 2.0x

KittyGalore

I'm marking solved for now if anyone thinks it's a bug then they can actually confirm it.
SMF Curve 2.0x

Shambles

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.

KittyGalore

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. :)
SMF Curve 2.0x

Advertisement: