Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
@see https://drupal.stackexchange.com/questions/246561/how-do-i-add-elements-...
Problem
Webform submissions are being rendered using a custom controller and templates
Solutions
Rework Webform Submission rendering to use EntityViewController.
Notes
- All submissions should be rendered via \Drupal\Core\Entity\EntityViewBuilder::view
- The outputted array should be available to hook_webform_submsision_view_alter().
Tasks
- Setup WebformSubmissionViewController
- Copy \Drupal\node\Controller\NodeViewController
- Proxy old rendering behavior
- Move templates into view controller
- Delete the below templates and preprocessors
Routes to be updated
- entity.webform_submission.canonical
- entity.webform_submission.table
- entity.webform_submission.text
- entity.webform_submission.yaml
Templates to be deleted
- webform-submission.html.twig
- webform-submission-yaml.html.twig
- webform-submission-text.html.twig
- webform-submission-table.html.twig
- webform-submission-html.html.twig
API Changes
Major reworking and simplification of webform submission rendering.
Comment | File | Size | Author |
---|---|---|---|
#6 | 2911463-view-controller-6.patch | 48.38 KB | jrockowitz |
|
Comments
Comment #2
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #3
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedMoving comments to main ticket
Comment #4
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #6
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #8
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commented