Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Since RouteCacheContext
/ RouteNameCacheContext
implement CacheContextInterface
, it could make sense to declare it as on the other cache contexts.
They appear to have been changed last on #2432837: Make cache contexts hierarchical (e.g. 'user' is more specific than 'user.roles').
Comment | File | Size | Author |
---|---|---|---|
#7 | 0001-Fixed-missing-CacheContextInterface-on-RouteCacheCon.patch | 1.56 KB | fgm |
#2 | 2459975-route-cache-context.patch | 1014 bytes | fgm |
Comments
Comment #1
fgmComment #2
fgmChecking.
Comment #3
dawehner+1
Comment #4
Wim LeersOMG this was just a straight-up bug. Great find!
Why this though? AFAIK We never repeat an "implements interface" statement when extending a class?
Comment #5
fgmThat's what I thought initially and why I didn't repeat the "implements" in RNCC since it was already in RCC. However, our practices on this issue appear to vary. Consider just the Cache API itself, copied from the source:
Seeing how this "implements" was repeated, I trod the same path, not seeing any standard for this question. We might want one, BTW: currently, all we have on interface use appears to be found at https://www.drupal.org/node/608152#interfaces
Comment #6
Wim LeersGreat find :) But
AccountPermissionsCacheContext
used to implement\Drupal\Core\Cache\CalculatedCacheContextInterface
in an earlier iteration of the patch, then was refactored. So let's just remove that extraneousimplements CacheContextInterface
inAccountPermissionsCacheContext
? :)Comment #7
fgmOK, then : rerolled.
Comment #8
dawehnerAlright
Comment #9
Wim LeersThanks!
Comment #10
alexpottThis issue is a minor bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 9db6e4e and pushed to 8.0.x. Thanks!