Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: a10 on December 28, 2019, 07:33:20 AM

Title: 2.0.16, error removing entries admin log
Post by: a10 on December 28, 2019, 07:33:20 AM
When trying to clean out old entries occured in 2.0.15:

Apply Filter: Only show the error messages of this URL
https://www.xxx/forum/index.php?action=admin;area=logs;sa=adminlog;type=3
Apply Filter: Only show the errors with the same message
Database error, given array of string values is empty. (uneditable)
Function: ViewModlog
Apply Filter: Only show the errors from this file
File: /customers/xxx/httpd.www/forum/Sources/Modlog.php
Line: 95


Line 95 for individual, line 78 for 'remove all'
(ps, running php 7.3, all worked with 2.0.15)

edit: tested with php 7.2, same.
Title: Re: 2.0.16, error removing entries admin log
Post by: shawnb61 on December 28, 2019, 01:18:54 PM
I cannot replicate this. 

Were there any errors encountered when applying 2.0.16?

Mods installed?

Can you show the lines of code you have around 78 & 95 in Modlog.php?

Also show lines of code ~62 & 63 in Modlog.php?
Title: Re: 2.0.16, error removing entries admin log
Post by: a10 on December 28, 2019, 01:45:22 PM
No errors in install. Mods listed in signature. Modlog attached.
Title: Re: 2.0.16, error removing entries admin log
Post by: shawnb61 on December 28, 2019, 02:18:13 PM
Somehow that matches the 2.0.15 version exactly.  No changes were applied to this file at all.  THAT doesn't make sense... 

Attached is the 2.0.16 equivalent.  You should be able to just swap out the file since there were no changes in your 2.0.15 version.

Hope this helps. 

Title: Re: 2.0.16, error removing entries admin log
Post by: a10 on December 28, 2019, 02:55:19 PM
Applied that modlog, still the error & entries not going away. Approx 20 entries.

Wondering if it's only the old entries from 2.0.15, and any new ones from 2.0.16 will be deletable.
Can produce some fresh entries, can the 24h 'lock' be removed so I can test immediately?
$context['hoursdisable'] = 24;  ...would 0 produce any explosions? :O)

Edit: did the above, same with fresh .16 entries as old from .15
"Database error, given array of string values is empty. (uneditable)"

And btw same problem with Moderation Log.


Title: Re: 2.0.16, error removing entries admin log
Post by: shawnb61 on December 28, 2019, 03:30:29 PM
Confirmed.  It's a bug. 

GDPR OFF, but mod & admin log ON, you will get this trying to clear your log.

I'll move this to the Bug Reports board.

THANX for the report. 

Logged as #102
Title: Re: 2.0.16, error removing entries admin log
Post by: a10 on December 28, 2019, 03:43:29 PM
Thanks for following up. ftm can delete stuff in db table if needed.
Title: Re: 2.0.16, error removing entries admin log
Post by: shawnb61 on December 28, 2019, 03:46:59 PM
The part that baffles me that the file attached above is from 2.0.15...   :o

You're clearly running 2.0.16 code, though, as those line #s wouldn't otherwise make sense. 

Title: Re: 2.0.16, error removing entries admin log
Post by: a10 on December 28, 2019, 04:02:23 PM
Argh :o  was a modlog from the files backup taken right before installing .16
So that clears up that part. Sorry for the confusion, good spotting from your side.

And tested with enabled gdpr, all is indeed well, quite special interaction :)

Title: Re: 2.0.16, error removing entries admin log
Post by: m4z on December 29, 2019, 04:56:27 PM
Also applies to Moderation log entries (https://www.simplemachines.org/community/index.php?topic=571034.msg4041495#msg4041495):
QuoteDatabase error, given array of string values is empty. (uneditable)
Function: ViewModlog
Apply Filter: Only show the errors from this file
File: /home/rootpath/public_html/smfpath/Sources/Modlog.php
Line: 80


Edit: I see the fix already includes this. <3
Title: Re: 2.0.16, error removing entries admin log
Post by: Vanomas on January 03, 2020, 10:30:16 AM
I also can confirm this for admin and moderator log even after 24 hours.
SMF 2.0.17
MySQL: 5.7.17
PHP: 5.6.3
Title: Re: 2.0.16, error removing entries admin log
Post by: BillLeeDee on January 04, 2020, 08:43:48 PM
Same error with clean install of 2.0.17. Glad I left my directory of 2.0.15 to go back to.
Title: Re: 2.0.16, error removing entries admin log
Post by: Scooter Trash on March 30, 2020, 09:59:09 PM
Is there a fix for this yet?

If not, which database table/s are the moderation log and administration log located in?
Title: Re: 2.0.16, error removing entries admin log
Post by: shawnb61 on April 02, 2020, 02:09:27 PM
There is a fix for this coming in 2.0.18. 

In the meanwhile, if you have very high volume activity in these logs & really need to clear them out occasionally, the following should work.  (Me, I'm just waiting for 2.0.18 myself...)

DELETE FROM `smf_log_actions`
WHERE id_log IN (2,3)
AND action NOT IN ('agreement_updated', 'policy_updated');


Notes:
- This will delete them regardless of time
- id_log of 2 = mod log; 3 = admin log
- You may need to change the table prefix to match your forum setting
Title: Re: 2.0.16, error removing entries admin log
Post by: Scooter Trash on April 02, 2020, 02:26:22 PM
Quote from: shawnb61 on April 02, 2020, 02:09:27 PM
There is a fix for this coming in 2.0.18. 

In the meanwhile, if you have very high volume activity in these logs & really need to clear them out occasionally, the following should work.  (Me, I'm just waiting for 2.0.18 myself...)

DELETE FROM `smf_log_actions`
WHERE id_log IN (2,3)
AND action NOT IN ('agreement_updated', 'policy_updated');


Notes:
- This will delete them regardless of time
- id_log of 2 = mod log; 3 = admin log
- You may need to change the table prefix to match your forum setting

Thanks Shawn.

Title: Re: 2.0.16, error removing entries admin log
Post by: aED on July 28, 2020, 09:44:07 PM
Do we have an ETA for 2.0.18?
Title: Re: 2.0.16, error removing entries admin log
Post by: m4z on July 29, 2020, 02:01:33 AM
No. But it will be after 2.1 RC3 (which also does not have a fixed release date). (https://www.simplemachines.org/community/index.php?topic=566669.0)
Title: Re: 2.0.16, error removing entries admin log
Post by: shawnb61 on February 01, 2021, 05:44:12 PM
Closing - This was addressed in 2.0.18.