Provide a way for an entity type to opt out of using ContentTemplateAwareViewBuilder

Created on 27 August 2025, 1 day ago

Overview

Drupal CMS just ran into a nasty bug where submitting a webform dies with a fatal error if XB is installed, because:

Error: Call to undefined method Drupal\experience_builder\EntityHandlers\ContentTemplateAwareViewBuilder::buildElements() in _webform_token_get_submission_values() (line 250 of modules/contrib/webform/webform.tokens.inc). 

It turns out that the view builder for webform_submission content entities implements a special interface specific to Webform (\Drupal\webform\WebformSubmissionViewBuilderInterface), which XB doesn't check for (and wouldn't be able to do anything about if it did).

Proposed resolution

XB should respect a supports_content_templates flag on the entity type definition. It should default to TRUE, but if it's FALSE, XB should not change its view builder, even if the entity type otherwise checks all the boxes that would be needed for it to use content templates. This would give Webform a way to prevent horrible breakages in the short term, while giving it the leeway it needs to properly integrate with content templates (if, indeed, it ever decides to support them for webform submissions).

πŸ› Bug report
Status

Active

Version

1.0

Component

… to be triaged

Created by

πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

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

Comments & Activities

Production build 0.71.5 2024