Details
-
Bug
-
Resolution: Fixed
-
High
-
None
Description
On a recent work for a client we had to set a cronjob to run the bin/php/trashpurge.php script every day to remove trashed objects older than a year.
On a bridge eZ installation we ran the trashpurge script using the following command:
/usr/bin/php ezpublish/console ezpublish:legacy:script --env=dev bin/php/trashpurge.php --siteaccess=amnh_admin --trashed-days=365
But instead of getting:
Running script 'bin/php/trashpurge.php' in eZ Publish legacy context Purging trash items: Found XX object(s) in trash for at least 356 days.
We were getting
... for at least 1231231234 days
The fix was to remove an additional strtotime from the trashpurge script
Wrong:
$options['trashed-days'] ? strtotime( "-{$options['trashed-days']} days" ) : null
Good:
$options['trashed-days'] ? (int)$options['trashed-days'] : null