- Issue created by @erik.erskine
- πΈπͺSweden erik.erskine
Did some digging, and found this in
FieldFormatterBase::view()
:// Field item lists, in particular for computed fields, may carry cacheable // metadata which must be bubbled. if ($items instanceof CacheableDependencyInterface) { (new CacheableMetadata()) ->addCacheableDependency($items) ->applyTo($elements); }
So it looks as though
ComputedFieldClass
needs to implementCacheableDependencyInterface
and pass on the cacheable metadata from the plugin. Patch coming up. - Merge request !16Make ComputedFieldClass implement CacheableDependencyInterface β (Open) created by erik.erskine
- πΈπͺSweden erik.erskine
First attempt at seeing how we might solve this. Needs work for sure, but wanted to get feedback on the approach.
- π¬π§United Kingdom joachim
> Did some digging, and found this in FieldFormatterBase::view():
Nice find!
I've fixed the broken tests -- could you rebase this please so the tests can run on it again?
- π¬π§United Kingdom joachim
Thanks!
I started looking at this, and figured I'd add test coverage. I've got something working (in branch 3487785-cacheability-tests) -- but I need to do a bit of clean-up on it as I had to try several approaches to get caching to kick in!
- π¬π§United Kingdom joachim
Hmm on second thoughts, I can't get it to work :/
Pushed everything to the branch.