Views time-based caching stores and custom duration as zero

Created on 29 June 2023, almost 2 years ago

Problem/Motivation

When using the Time-based (vs Tag-based) Views cache plugin, one can either use predefined durations (why isn't there a "1 day" duration, BTW ?), or use a custom duration, for which one has to input a duration in seconds.

However, these values are interpreted as 0 when saving the view.

Steps to reproduce

  • Open a core view, e.g. frontpage.
  • Change it to use time-based caching instead of tag based
  • Configure to use predefined values e.g. 6 days / 6 days
  • Save the view: values are OK
  • Configure to use one custom and one predefined value e.g. custom 86400 seconds / 6 days
  • Save the views: values are now 0 seconds / 6 days.
  • Same for the opposite case: 6 days / 86400 seconds is 6 days / 0 seconds after saving
  • Same when using custom values for both.
  • Marginal test: use a custom value matching a predefined value: same result 0 seconds
  • export the view: the cache/options/(result|output)_lifespan properties are set to 0 for the fields set to a custom value, which suggests this is the mechanism meant to be used to identify the presence of custom values.

When manually editing a view to set cache/options/(result|output)_lifespan[_custom], we can observe that the result displayed in the UI after importing the edited views is always the value of the cache/options/(result|output)_lifespan property, not cache/options/(result|output)_lifespan_custom one. This show the problem to be twofold:

  • Saving a zero predefined value when a custom value is used
  • Ignoring all custom values, using the predefined value instead, when loading a view

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Closed: duplicate

Version

10.1 ✨

Component
ViewsΒ  β†’

Last updated about 15 hours ago

Created by

πŸ‡«πŸ‡·France fgm Paris, France

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024