You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an Entry has a postDate in the future (pending) the \craft\base\Element::@$enabledForSite is disabled.
Once the postDate is in the past this (and other fields) becomes enabled, but the API will still return the old disabled value. Adding a random cache-busting query parameter to the API call will return the correct new state.
We use Craft as a headless CMS and want to be able to schedule articles in the future. However the cache isn't expired when the postDate is in the past.
Steps to reproduce
Create an Entry that will be published in the future
Request the Entry via the API with the criteria status set to [Entry::STATUS_LIVE, Entry::STATUS_PENDING]
Observe the enabledForSite state being false
Wait for the Entry to become public
Refetch the data via the API
The enabledForSite is still reported as false
Of course all other data is also stale; the status etc etc
Additional info
Craft version: 4.8.1
PHP version: 8.1
Database driver & version: mysql 5.7
Plugins & versions: Element API 3.0.1.1
The text was updated successfully, but these errors were encountered:
Sorry, just realized you are talking about post dates, not expiry dates. I’ll have to think a bit more on that one, as we don’t currently have any code in place for restricting cache durations based on post date.
Description
When an Entry has a postDate in the future (pending) the
\craft\base\Element::@$enabledForSite
is disabled.Once the postDate is in the past this (and other fields) becomes enabled, but the API will still return the old disabled value. Adding a random cache-busting query parameter to the API call will return the correct new state.
We use Craft as a headless CMS and want to be able to schedule articles in the future. However the cache isn't expired when the postDate is in the past.
Steps to reproduce
status
set to[Entry::STATUS_LIVE, Entry::STATUS_PENDING]
enabledForSite
state being falseenabledForSite
is still reported as falseAdditional info
The text was updated successfully, but these errors were encountered: