Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable/test bubbleArgMetadata($arg) for our twig extensions #207

Open
DiegoPino opened this issue Jun 27, 2022 · 1 comment
Open

Enable/test bubbleArgMetadata($arg) for our twig extensions #207

DiegoPino opened this issue Jun 27, 2022 · 1 comment
Assignees
Labels
Drupal 9 Everyone's favorite version until Drupal 10 comes enhancement New feature or request Field Formatter The thing that glues the pieces and adds glitter metadata Meta(l) data Twig Extension Make those flowers reach the sun Twig Twig template processing
Milestone

Comments

@DiegoPino
Copy link
Member

What?

Because twig extensions render things directly, sometimes their own cache tags get lost on the actual Field Formatter level render. Means if an URL or something changes the Field Formatter is not aware and does not clear up the caches. This is very important if we are e.g rendering URLS with tokens or any access needs that need to be refreshed constantly

Core Twig Extensions have a helper method protected function bubbleArgMetadata($arg) that does this. We could do something similar and then on the actual native Metadata Display Rendering make use of those bubbled Metadata Cache tags

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Template%21TwigExtension.php/9.4.x

@aksm @patdunlavey what do you both think?

@DiegoPino DiegoPino self-assigned this Jun 27, 2022
@DiegoPino DiegoPino added enhancement New feature or request Twig Twig template processing metadata Meta(l) data Drupal 9 Everyone's favorite version until Drupal 10 comes Field Formatter The thing that glues the pieces and adds glitter Twig Extension Make those flowers reach the sun labels Jun 27, 2022
@DiegoPino DiegoPino added this to the 1.1.0 milestone Jun 27, 2022
@patdunlavey
Copy link
Collaborator

#392 merged to 1.2.
#393 awaiting merge to 1.3
This addresses the issue in \Drupal\format_strawberryfield\Controller\MetadataExposeDisplayController::castViaTwig

@DiegoPino but it appears to also be an issue in \Drupal\format_strawberryfield\Controller\MetadataDisplaySearchController::searchWithMetadataDisplay. Shall I create PRs for 1.2 and 1.3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Drupal 9 Everyone's favorite version until Drupal 10 comes enhancement New feature or request Field Formatter The thing that glues the pieces and adds glitter metadata Meta(l) data Twig Extension Make those flowers reach the sun Twig Twig template processing
Projects
None yet
Development

No branches or pull requests

2 participants