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
Update 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
View page @ ed82d761
**note : this is a work in progress. No expiration is yet implemented on Framaforms, causing large database management problems. .**
**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.**
**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 :
......@@ -26,4 +26,10 @@ delete from node where (type='form1' or type='webform') and to_timestamp(created
## USER NOTIFICATION
Possible process :
* each day, the Drupal automated cron launches a hook (defined in the framaforms module) which will check in the Postgres tables *node* (webforms) and *webform_submissions* (answers to forms) for rows aged over 6 months, minus two weeks (26 weeks). For each, it will set the "notified" field to 1 in a new "webforms_expiration" table (**to be created**) in the Postgres database.
* the hook will get the corresponding user emails and send them a preconfigured email notifying them of their webform expiration, and giving them a token to extend the webform's lifetime by 6 months.
* accessing this token will set the "notified" field to 2, corresponding to the user having extended the webform by six month (3 = second extension, 4 = fourth, etc.) That way the cron wil only delete every day the webforms aged of exactly 6 months, and whose "notified" field is set to 1 (the user was notified but did nothing).
* the cron should also perform the same process for rows aged over 6 months.
*check the possibility of adding a column to an existing table in postgres*
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