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.
Problem/Motivation
External entities with a UUID as ID or any ID containing characters not accepted by hook_theme_suggestions_HOOK() generate unusable template name suggestions. The template name suggestion doesn't work, and could be hard to figure out why. Twig debugging makes notice of this.
it looks like this when twig debugging is enabled:
<!---
INVALID FILE NAME SUGGESTIONS:
See https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!theme.api.php/function/hook_theme_suggestions_alter
external_entity__b719a2fa-e401-4c97-b0b2-c33cb2a97693__full
external_entity__b719a2fa-e401-4c97-b0b2-c33cb2a97693
--->
Steps to reproduce
- Configure an external entity using a UUID or other form of ID with illegal template name characters
- Enable twig debugging
- Visit a page containing an external entity, like the detail page
Proposed resolution
sanitize the ID while generating theme suggestions.
Comment | File | Size | Author |
---|---|---|---|
#4 | 3419507_adds_sanitation.patch | 1.28 KB | pefferen |
|
Issue fork external_entities-3419507
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
pefferen CreditAttribution: pefferen as a volunteer commentedComment #4
pefferen CreditAttribution: pefferen at Kunstmuseum Den Haag, European Commission and European Union Institutions, Agencies and Bodies commentedadding patch file for use in composer