Steps to reproduce:
1. Create a view using a user contextual filter. Set the user contextual filter up to fall back to the current user.
2. Check the exported views YAML and see it has the route cache context.
This is because ArgumentPluginBase always adds the url cache context.
/**
* {@inheritdoc}
*/
public function getCacheContexts() {
$contexts = [];
// By definition arguments depends on the URL.
// @todo Once contexts are properly injected into block views we could pull
// the information from there.
$contexts[] = 'url';
// Asks all subplugins (argument defaults, argument validator and styles).
if (($plugin = $this->getPlugin('argument_default')) && $plugin instanceof CacheableDependencyInterface) {
$contexts = Cache::mergeContexts($contexts, $plugin->getCacheContexts());
}
No idea, but if we had a way to specify that the argument is always going to come from the request and never from the URL it might be possible to skip this. Maybe a dedicated User-from-request argument implementing a different interface or something and this overrides that method to not add the URL cache context.
Active
11.0 π₯
Last updated
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.