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

Commit 7c279b3

Browse files
authored
Merge pull request #62 from OS2Forms/44236_global_submission_purge
44236 global submission purge
2 parents cab3eb4 + 726a136 commit 7c279b3

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 of all users submissions.
156+
$webform->setSetting('purge', 'all');
157+
// Set purge of submissions more than 30 days old.
158+
$webform->setSetting('purge_days', '30');
159+
}
160+

0 commit comments

Comments
 (0)