Problem/Motivation
All Webforms listed on Content languages configuration form (/admin/config/regional/content-language) eventhough Webform submissions are not translateable.
From @mpp (Drupal Slack)
Could someone explain why *each* webform is an entity bundle?
I'm not sure if this is a very scalable approach, a website with 10,000 webforms would have a huge config base to sync. Also on the language UI one would have to configure 10,000 bundles.
Proposed resolution
OPTION 1: Alter Content languages configuration form and hide webform submissions.
OPTION 2: Remove webform bundle information for the Webform Submission entity.
Notes
Bundle settings were included because webform submission entity annotation was copied from the node entity annotation. Webform submission might not require bundle=webform
Remaining tasks
TDB
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 3049023-9.patch | 7.88 KB | jrockowitz |
| #8 | 3049023-OPTION-1-8.patch | 1.13 KB | jrockowitz |
| #2 | 3049023-OPTION-1-2.patch | 835 bytes | jrockowitz |
| #2 | 3049023-OPTION-2-2.patch | 1.27 KB | jrockowitz |
Comments
Comment #2
jrockowitz commentedOPTION 1: Seems like a safer solution.
OPTION 2: Patch does not remove 'Webform submission' from Content languages configuration form
Comment #3
jrockowitz commented@Berdir posted an explanation on Drupal Answers.
When to use Bundles vs Entity Types [design]
Comment #5
jrockowitz commentedComment #6
mpp commentedfrom slack:
@jrockowitz, I'd go for option 2 to remove the bundle but as you can see using a bundle has a lot of implications.
@mpp I am not sure I can remove the bundle without causing major regressions.
Comment #7
jrockowitz commentedI think using the bundle relationship is required and needed because it makes sure when webform is deleted all related submissions are deleted.
The bundle might also be required for #3002547: Allow fieldable webform submissions
Comment #8
jrockowitz commentedI am concerned that sites may have existing
language.content_settings.webform_submission.*filesThe attached patch only removes 'Webform submission' from the Content language admin settings form, only when there are no previously saved
language.content_settings.webform_submission.*config files.We could write an update hook that deletes all previously saved
language.content_settings.webform_submission.*config files. This could cause a lot of problems for people using config import.Another approach would be to remove all previously saved
language.content_settings.webform_submission.*config files via thedrush webform:repaircommand.Comment #9
jrockowitz commentedMoving ahead with OPTION 1.
The attached patch includes an update hook and `drush webform-repair` support which removes unneeded language.content_settings.webform_submission.* configuration.
Comment #10
jrockowitz commentedComment #11
jrockowitz commentedComment #13
jrockowitz commented