Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Jayme65 on April 08, 2020, 04:48:42 AM

Title: 2.0.16 Update Test Failure (Modlog.php)
Post by: Jayme65 on April 08, 2020, 04:48:42 AM
Hello,
While updating from 2.0.15 to 2.0.16 I get this error reported in the test window:
Execute Modification   ./Sources/Modlog.php   Test failed

The edit icon to the left displays 2 lines:
'value' => $txt['modlog_' . ($context['log_type'] == 3 ? 'admin' : 'moderation') . '_log_desc']
. (!empty($modSettings&#91;'force_gdpr'&#93;) && $context&#91;'log_type'&#93; == 3 ? '<br />' . $txt&#91;'modlog_admin_log_gdpr_no_delete'&#93; : '')

I've downloaded this Modlog.php and searched for those two lines...but they do not exist.
Would you please help me know what I'm supposed to do?
Thanks
Title: Re: 2.0.16 Update Test Failure (Modlog.php)
Post by: Looking on April 08, 2020, 10:40:08 AM
If you have mods installed the lines may be altered. Look for similar rather than exact lines to see where they might fit. You can do that by using part of the line that needs to be changed. Whatever  you do make sure to backup everything first.
Title: Re: 2.0.16 Update Test Failure (Modlog.php)
Post by: Sir Osis of Liver on April 08, 2020, 12:39:15 PM
Look for this in two places -



== 3 ? 'admin' : 'moderation') .



For reasons unknown, your browser is displaying html char codes instead of right/left brackets.
Title: Re: 2.0.16 Update Test Failure (Modlog.php)
Post by: Jayme65 on April 08, 2020, 02:13:28 PM
Quote from: Sir Osis of Liver on April 08, 2020, 12:39:15 PM
Look for this in two places -



== 3 ? 'admin' : 'moderation') .



For reasons unknown, your browser is displaying html char codes instead of right/left brackets.

When I search directly in the file via cpanel > file manager > edit (instead of downloading the file by FTP) I can find two line including
($context['log_type'] == 3 ? 'admin'
What am I now supposed to do please?
Title: Re: 2.0.16 Update Test Failure (Modlog.php)
Post by: Jayme65 on April 10, 2020, 04:06:54 PM
Could you please help me to understand what has to be done to solve my problem?
Title: Re: 2.0.16 Update Test Failure (Modlog.php)
Post by: Chen Zhen on April 10, 2020, 04:18:51 PM

Liver was trying to tell you that you posted search text containing char code equivalents for square brackets.

The two lines you posted that you are looking for a match are:

'value' => $txt['modlog_' . ($context['log_type'] == 3 ? 'admin' : 'moderation') . '_log_desc']



. (!empty($modSettings['force_gdpr']) && $context['log_type'] == 3 ? '<br />' . $txt['modlog_admin_log_gdpr_no_delete'] : '')


Look for those 2 & do your replacements.
Hopefully your replacements are not subbing the square brackets for ascii char codes.
Title: Re: 2.0.16 Update Test Failure (Modlog.php)
Post by: Jayme65 on April 10, 2020, 04:39:37 PM
Sorry if I sound stupid but I can't get it.
I can see those lines (written correctly) if I edit modlog directly from within the 'File Manager' in cPanel...so what do I have to do now?
You tell me 'do your replacement'...what replacement?
Title: Re: 2.0.16 Update Test Failure (Modlog.php)
Post by: Chen Zhen on April 10, 2020, 04:57:50 PM
You should only see the 1st one if the edit did not go through.
The parser attempted to add the second one afterward.
If the line already looks like the replacement shown below, then do not bother because the edit should already be there.
Attach the file if you do not understand.

file: ../Sources/Modlog.php

find:

'value' => $txt['modlog_' . ($context['log_type'] == 3 ? 'admin' : 'moderation') . '_log_desc'


replace with:

'value' => $txt['modlog_' . ($context['log_type'] == 3 ? 'admin' : 'moderation') . '_log_desc' . (!empty($modSettings['force_gdpr']) && $context['log_type'] == 3 ? '<br />' . $txt['modlog_admin_log_gdpr_no_delete'] : '')


Save the changes.
Title: Re: 2.0.16 Update Test Failure (Modlog.php)
Post by: Jayme65 on April 10, 2020, 05:22:15 PM
Thanks!! This time I got it ;)