Use taxonomy_term_list:BUNDLE cache tag in WebformTermReferenceTrait for more granular invalidation

Created on 9 July 2023, 12 months ago
Updated 20 July 2023, 11 months ago

Problem/Motivation

Drupal Core added the ENTITY_TYPE_list:BUNDLE cache tag per https://www.drupal.org/node/3107058 β†’ . \Drupal\webform\Element\WebformTermReferenceTrait::setOptions currently outputs just the taxonomy_term_list cache tag. It can swap to outputting taxonomy_term_list:{{vocabulary_id}} to more selectively respond to cache invalidations when terms / vocabularies are updated.

Steps to reproduce

  1. Have a webform that uses the webform_term_select element with options from a taxonomy vocabulary
  2. Enable http.response.debug_cacheability_headers: true per https://www.drupal.org/node/2592471 β†’ to see X-Drupal-Cache-Tags debug values
  3. Hit the page, check X-Drupal-Cache-Tags values, it will contain just the taxonomy_term_list cache tag

Proposed resolution

Update \Drupal\webform\Element\WebformTermReferenceTrait::setOptions to set the more specific taxonomy_term_list:{{vocabulary_id}} cache tag.

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Fixed

Version

6.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States angrytoast Princeton, NJ

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

Comments & Activities

Production build 0.69.0 2024