Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions src/Controller/MetadataExposeDisplayController.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,20 +268,19 @@ public function castViaTwig(
'format_strawberryfield.iiif_settings'
)->get('pub_server_url');
$original_context = $context + $context_embargo;
// Allow other modules to provide extra Context!
// Call modules that implement the hook, and let them add items.
\Drupal::moduleHandler()->alter(
'format_strawberryfield_twigcontext', $context
);
// In case someone decided to wipe the original context?
// We bring it back!
$context = $context + $original_context;
$cacheabledata = [];
// @see https://www.drupal.org/node/2638686 to understand
// What cacheable, Bubbleable metadata and early rendering means.
$cacheabledata = $this->renderer->executeInRenderContext(
new RenderContext(),
function () use ($context, $metadatadisplay_entity) {
function () use ($context, $original_context, $metadatadisplay_entity) {
// Allow other modules to provide extra Context!
// Call modules that implement the hook, and let them add items.
\Drupal::moduleHandler()->alter(
'format_strawberryfield_twigcontext', $context
);
// In case someone decided to wipe the original context?
// We bring it back!
$context = $context + $original_context;
return $metadatadisplay_entity->renderNative($context);
}
);
Expand Down