-
-
Save dawehner/283fb5ab0dcd0ceefc88df9afc84e0ec to your computer and use it in GitHub Desktop.
@wimleers So what I was thinking was creating a render context, execute ```$item->processed``` in there, and then call ```$this->bubble($render_context->bubble());``` |
$Item->processed
is using the fieldapi magic, sorry, I should have made this clear.
If you "call" $item->processed
, its called out \Drupal\text\TextProcessed
to retrieve its value: \Drupal\text\TextProcessed::getValue
... which calls out to check_markup
, which renders it using ::renderPlain
.
So in case we would create a render context around this magic here, wouldn't we be able to catch the cacheability metadata from the render context?
Ah! Yes, that's possible. Except in the case of $item->processed
already having been generated. Then the magic wouldn't happen again, and we wouldn't be able to catch the cacheability metadata.
Copied this discussion verbatim to https://www.drupal.org/node/2626924#comment-11795251, for future reference/to avoid linkrot.
Let's continue there.
What does
Either it exists, or it doesn't. When it doesn't exist, it's generated by
\Drupal\text\TextProcessed::getValue()
. When it does exist, it's aMarkupInterface
instance, which doesn't allow cacheability metadata to be retrieved, nor does it allow "execution" of any way.So, can you clarify?