Problem/Motivation

View cache plugins have a get cacheExpire() method which seems to retroactively check the cache expiration based on cache->created.

Cache expiration is set on cache set, there's no need for any of this

Steps to reproduce

Proposed resolution

Deprecate the method, stop calling it.

Found at least two implementations in contrib that use this, in metatag_views and search_api.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3576556

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

berdir created an issue. See original summary.

berdir’s picture

Status: Active » Needs review

It's a minor thing but I was quite confused about this method while working on views_custom_cache_tag, why it exists and what the difference between this and \Drupal\views\Plugin\views\cache\CachePluginBase::cacheSetMaxAge() is.

lendude’s picture

Status: Needs review » Reviewed & tested by the community

Checked the Views D7 repo and yeah this is very much a remnant of D7 caching. Nice clean up.

catch made their first commit to this issue’s fork.

  • catch committed 4b1f0964 on 11.x
    task: #3576556 Deprecate CachePluginBase::cacheExpire
    
    By: berdir
    By:...

  • catch committed e123a46d on main
    task: #3576556 Deprecate CachePluginBase::cacheExpire
    
    By: berdir
    By:...

catch’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to main and 11.x, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.