esmero / format_strawberryfield

Set of Display formatters, extractors and utils to make Strawberry field data glow
GNU Lesser General Public License v3.0
6 stars 9 forks source link

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

Open DiegoPino opened 2 years ago

DiegoPino commented 2 years ago

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?

patdunlavey commented 9 months ago

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?