- Issue created by @donquixote
- Merge request !45Issue #3426640: Collect cache metadata also when result is empty. β (Open) created by donquixote
- last update
8 months ago 1 pass - Assigned to selvira
- Status changed to Needs review
8 months ago 8:40am 12 March 2024 - π¬π§United Kingdom code-brighton
I can confirm this patch works. I had the same issue that had me confused for days, it seemed like a random issue, but thank you for this great work, I was able to consistently recreate the issue (by filtering so I got an empty result, which then cached the view always as empty) Using the merge request patch the issue was solved. Thank you @selvira !
- last update
7 months ago 1 pass - π¨πSwitzerland dpacassi ZΓΌrich, Switzerland
Adding a static file from the current stage of https://git.drupalcode.org/project/viewsreference/-/merge_requests/45 in case the MR gets updated/rerolled.
-
joekers β
committed 70488364 on 8.x-2.x
Issue #3426640 by donquixote: Cache metadata is not captured when no...
-
joekers β
committed 70488364 on 8.x-2.x
- Status changed to Fixed
7 months ago 1:04pm 15 April 2024 - π¬π§United Kingdom joekers UK
Thanks for raising the issue and for the fix - I've committed it to the dev branch.
Also thanks to those for testing it.
Automatically closed - issue fixed for 2 weeks with no activity.
- π¬π§United Kingdom scott_euser
It seems this has unfortunately caused a regression, follow-up raised in π Cache metadata is not captured when no results Fixed
- Issue was unassigned.
- π©πͺGermany donquixote
The non-lazy formatter uses addCacheableDependency($view) yet the addCacheableDependency() method bails as soon as it sees that the object does not implement CacheableDependencyInterface (which views does not).
Ouch. My mistake.
I thought I had seen this somewhere else, but in fact it was not the ViewExecutable that was added, but the View config entity itself.
I see the correct solution seems to be to add the `$render_array` which should contain the '#cache' data.