Open PLP-GTR opened 8 months ago
@PLP-GTR Why not just remove the datediff? The original idea was to find all activities that have been created by a member that has been banned because of spamming and that lasted longer than a day. Issue #248 says just show all activities of banned members to remove them if necessary. No need to check anything else.
@PLP-GTR Regarding the heads up: In the dev environment most of the times newly introduced classes are found automatically. In the few cases that doesn't help you need to call php bin/console cache:clear. (Which is also needed to create the cache on production.)
@PLP-GTR Why not just remove the datediff? The original idea was to find all activities that have been created by a member that has been banned because of spamming and that lasted longer than a day. Issue #248 says just show all activities of banned members to remove them if necessary. No need to check anything else.
Three reasons:
+1
I can change the handling if you want, no problem. Let me update #248 and draft this pull request.
Heads up: I don't know if auto loader for has to be rebuild manually or the new class in
src/Doctrine/Functions/TimestampDiff.php
is automatically found.I have changed the filter for the admin/spam activities (production link):
from
to
Result:![image](https://github.com/BeWelcome/rox/assets/3023230/f8dfea6a-a7df-402b-af9c-55d03d85d556)
When writing
App\Doctrine\Functions\TimestampDiff
I tried to stick to the instructions here: → https://www.doctrine-project.org/projects/doctrine-orm/en/2.17/cookbook/dql-user-defined-functions.htmlThe seemingly simpler approach to use
DATEDIFF(a.ends, a.starts) >= 0
would have lead to the issue, that activities with an end time prior to the start time on the same day would show up. Although this shouldn't be possible at storage logic already, the "> 1" filter was preventing those from showing up, so I kept this logic.Fixes #248