incorrect & incomplete docs for CachePluginBase::cacheSetMaxAge()

Created on 15 October 2024, 9 days ago

Problem/Motivation

The docs for Drupal\views\Plugin\views\cache\CachePluginBase::cacheSetMaxAge() say:

> * Determine cache expiration time.

and there is no @return documentation.

This makes it look like the function returns the expiry time value to be put into the cache.

However, looking at cacheSet() in the same class, we can see it expects a relative offset from the request time:

        $expire = ($this->cacheSetMaxAge($type) === Cache::PERMANENT) ? Cache::PERMANENT : (int) $this->view->getRequest()->server->get('REQUEST_TIME') + $this->cacheSetMaxAge($type);

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

11.0 🔥

Component

documentation

Created by

🇬🇧United Kingdom joachim

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024