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.
Problem/Motivation
According to @quietone: "Took another look and everything about this doc block is wrong, including the @param. We need someone who knows views to sort this one out."
* Determine expiration time in the cache table of the cache type
* or CACHE_PERMANENT if item shouldn't be removed automatically from cache.
*
* Plugins must override this to implement expiration in the cache table.
*
* @param $type
* The cache type, either 'query', 'result'.
Proposed resolution
* Determine cache expiration time.
*
* Plugins must override this to implement expiration in the cache table. The
* default is CACHE_PERMANENT, indicating that the item will not be removed
* automatically from cache.
*
* @param string $type
* The cache type.
Remaining tasks
Patch
Review
Commit
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
None
Comment | File | Size | Author |
---|---|---|---|
#3 | 3250482-3.patch | 1.03 KB | quietone |
Comments
Comment #2
quietone CreditAttribution: quietone as a volunteer commented@daffie, thanks for making this issue.
Added details to the IS and updated the title.
Regarding the $type parameter, there are other places in the file that state 'The cache type, either 'query', 'result'.' But I found that it can be can be 'output', see \Drupal\views\Plugin\views\cache\Time::getDefaultCacheMaxAge. I found that \Drupal\views\ViewExecutable::execute sets the type to 'results'. I did not find an instance where 'query' was used.
Comment #3
quietone CreditAttribution: quietone as a volunteer commentedAnd a patch implementing the proposed resolution.
Comment #4
rajveergangwarHi @Quietone,
Patch looks good to me. Marking it review and tested by community.
Comment #5
daffie CreditAttribution: daffie commented+1 for RTBC.
Comment #6
quietone CreditAttribution: quietone as a volunteer commentedStarting tests
Comment #9
catchThis probably never got updated since before cache tags and views were a thing.
Committed/pushed to 9.4.x and cherry-picked to 9.3.x, thanks!
Comment #10
rajveergangwari didn't recieved credit? is something i need to do it ?
Comment #11
catch@rajveergang a 'looks good to me' isn't generally enough to receive credit, it would need to be more like 'this looks good to be because [reason] [reason]' referring to why the patch resolves the problem. However, generally it's hard to get credit for reviewing a trivial patch unless you find an issue with it, or can document research done.
Comment #12
rajveergangwar@catch,
You are right. I will keep in mind next time :)