Add option to store messages from contact forms

Created on 17 June 2016, over 8 years ago
Updated 7 April 2023, over 1 year ago

Problem/Motivation

As part of #2582955: Contact module roadmap: 80% usecase of webforms in core first step is to bring contact message storage from contact_storage into core.

Proposed resolution

Add boolean 'store messages' to each ContactForm content entity to optionally store submitted messages
Add new field to schema
Add said field to ContactFormEditForm
Add update hook to set default value (false)
Alter message entity to add an ID and langcode
Add a new storage handler that extends from the default SQL storage but with a custom ::save() implementation. If the bundle entity does not have the 'store messages' flag set to TRUE, do nothing in save, otherwise defer to the parent.
Alter message entity to use this storage handler.
Update hook to create missing entity fields/table (in a fashion sympathetic to sites that already have contact_storage module enabled - we can test against contatct_storage_test module is already in core).
Test coverage

Remaining tasks

All of the above

User interface changes

New field on Contact Form edit form to toggle storage of messages

API changes

None

Data model changes

New table for storage of messages.
New ID and langcode base fields for Message entity.

Feature request
Status

Closed: outdated

Version

10.1

Component
Contact 

Last updated 1 day ago

Created by

🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024