Skip to content

Commit

Permalink
[TASK] Exclude events without enddate from GDPR cleanup task
Browse files Browse the repository at this point in the history
Refs #1215
  • Loading branch information
derhansen committed Mar 22, 2024
1 parent 8d81dc7 commit f307595
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Classes/Service/MaintenanceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ protected function getGdprCleanupRegistrations(int $days): array
$queryBuilder->expr()->lte(
'e.enddate',
$queryBuilder->createNamedParameter($maxEndDate->getTimestamp(), Connection::PARAM_INT)
),
$queryBuilder->expr()->gt(
'e.enddate',
$queryBuilder->createNamedParameter(0, Connection::PARAM_INT)
)
)->executeQuery()
->fetchAllAssociative();
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
tags:
- name: 'console.command'
command: 'sf_event_mgt:cleanup:gdpr'
description: 'Delete registrations of expired events'
description: 'Delete registrations of expired events (registrations for events with no enddate will be ignored)'
schedulable: true

DERHANSEN\SfEventMgt\EventListener\ChangeCacheTimeout:
Expand Down
7 changes: 6 additions & 1 deletion Documentation/ForAdministrators/CliCommands/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ saved registration field data for expired events, a CLI command is available.

**Arguments**

* `days` - Amount of days reduced from todays date for expired event selection
* `days` - Amount of days reduced from todays date for expired event selection.

**Options**

Expand All @@ -63,3 +63,8 @@ Output
:class: with-shadow

It is recommended to setup a scheduler task to execute the CLI command periodically.

.. note::

The GDPR cleanup only includes events, which have a start- and enddate. Events with no enddate are
not covered by the cleanup, since it is not possible to calculate, when the event has ended.

0 comments on commit f307595

Please sign in to comment.