- First commit to issue fork.
- First commit to issue fork.
filefield_paths_process_string() which handles file's name & path to transformations makes use of token replacement.
In some case, token replacement leads to triggering some rendering. When this occurs in a "non-webpage" context, such as JSON:API or REST requests, this rendering create caching metadata which bubble up and is never catched/handled, leading to one of the most absconse/undebuggable error of a D8 project right now : the dreaded
"LogicException: The controller result claims to be providing relevant cache metadata, but leaked metadata was detected. Please ensure you are not rendering content too early"
I think filefield_paths_process_string() must wrap its logic in a render context to catch the generated metadata and handle it.
Needs work
1.0
Code
The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.