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
Comment #2
jhedstromComment #3
jhedstromComment #4
jhedstromOops, I'd left the values from auto block scheduler instead of start/end. This fixes that.
Comment #6
geoanders commentedThis makes sense and I have added into latest branch for new release. Thanks!
Comment #7
geoanders commented