Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.

Commit e982ad4

Browse files
author
Mads Nørgaard
committed
Adding purge logic to all webform submissions.
1 parent d9ec840 commit e982ad4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

os2forms_forloeb.module

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,15 @@ function end_notification_batch_function($processID, $queueID) {
146146

147147
return TRUE;
148148
}
149+
150+
/**
151+
* Implements hook_ENTITY_TYPE_create()
152+
* Sets a global purge setting for all webform submissions to 30 days
153+
*/
154+
function os2forms_forloeb_webform_create(\Drupal\webform\WebformInterface $webform) {
155+
// Set purge authenticated and anonymous users submissions.
156+
$webform->setSetting('purge', 'all');
157+
// Set purge submissions more than 30 days old.
158+
$webform->setSetting('purge_days', '30');
159+
}
160+

0 commit comments

Comments
 (0)