Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • Yakforms Yakforms
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 61
    • Issues 61
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 11
    • Merge requests 11
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • YakformsYakforms
  • YakformsYakforms
  • Wiki
  • Expiration of webforms

Expiration of webforms · Changes

Page history
Create Expiration of webforms authored Feb 24, 2020 by theo lem's avatar theo lem
Hide whitespace changes
Inline Side-by-side
Expiration-of-webforms.md 0 → 100644
View page @ c14042cd
**note : this is a work in progress. No expiration is yet implemented on Framaforms, causing large database management problems. .**
The webforms and their submissions should be automatically deleted under 6 months in the PostgreSQL database if no user action is taken.
The user should be notified 2 weeks in advance of their webform submission, and a link should enable them to give 6 more months of lifetime to their webform.
## SQL QUERY
** the following queries can be executed through a hook on webform access by a user, or on the Drupal hook_cron. The queries should be executed once a day.**
#### DELETE SUBMISSIONS
The following postgres query gets all webform **submissions** that are over 6 months old :
```
select sid, to_timestamp(submitted) from webform_submissions where to_timestamp(submitted) < date_trunc('day', NOW() - interval '6 months') ;
```
The following should delete them :
```
delete from webform_submissions where to_timestamp(submitted) < date_trunc('day', NOW() - interval '6 months');
```
#### DELETE WEBFORMS
The creation timestamp for webforms is stored in the 'created' column of the 'node' table. We also need to filter for node types because all Drupal nodes are stored in the same 'node' table regardless of what they are (page, article, webform).
Hence the following request :
```
delete from node where (type='form1' or type='webform') and to_timestamp(created) < date_trunc('day', NOW() - interval '6 months');
```
## USER NOTIFICATION
Clone repository
  • Changing an instance language
  • Common issues
  • Configuring Yakforms
  • Custom scripts
  • Enhancing Yakforms
  • Expiration of webforms
  • From Framaforms to Yakforms
  • Installing Yakforms through the installation profile
  • Module : yakforms
  • Module : yakforms_public_results
  • Module : yakforms_share_results
  • Module : yakforms_spam
  • Produce a release
  • Translating Yakforms
  • Working with the Yakforms feature
View All Pages