This is a corresponding issue to the one for Auto Block Scheduler in #3096732: AutoBlockScheduler condition should implement getCacheMaxAge.

Problem/Motivation

Since the condition plugin can be executed, and then stored on a cached page, the published on or unpublished on setting may not trigger at the appropriate time.

Proposed resolution

Implement getCacheMaxAge and set to either the start date if this is in the future, or the end if the block is already published. Since this is a max-age in seconds, calculating the time in seconds between the current time and the published/unpublished time will be necessary.

This way the condition will be re-evaluated at the appropriate time.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

jhedstrom created an issue. See original summary.

jhedstrom’s picture

Issue summary: View changes
jhedstrom’s picture

Status: Active » Needs review
StatusFileSize
new4.49 KB
jhedstrom’s picture

StatusFileSize
new1.65 KB
new4.43 KB

Oops, I'd left the values from auto block scheduler instead of start/end. This fixes that.

  • geoanders committed a2ffbc6 on 2.0.x
    Issue #3096738 by jhedstrom: Expiry condition should implement...
geoanders’s picture

Status: Needs review » Fixed

This makes sense and I have added into latest branch for new release. Thanks!

geoanders’s picture

Status: Fixed » Closed (fixed)