@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.

CommentFileSizeAuthor
#6 2911463-view-controller-6.patch48.38 KBjrockowitz

Comments

jrockowitz created an issue. See original summary.

jrockowitz’s picture

jrockowitz’s picture

Title: Add support for hook_webform_submsision_view_alter() » Rework Webform Submission rendering to use EntityViewController.

Moving comments to main ticket

jrockowitz’s picture

Issue summary: View changes

  • jrockowitz committed 460e61f on 2911463-view-controller
    Issue #2911463: Rework Webform Submission rendering to use...
jrockowitz’s picture

Status: Active » Needs review
StatusFileSize
new48.38 KB

  • jrockowitz committed 0c4d2f2 on 8.x-5.x
    Issue #2911463 by jrockowitz: Rework Webform Submission rendering to use...
jrockowitz’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.