Schedule Drafts to publish #11661
-
|
Brought up by James in the Discord https://discord.com/channels/456442477667418113/456442477667418115/999963733558296666 but does make a lot of sense. We can schedule a publish date for any Entry, but we can't schedule publication of a Draft? At least not that I'm aware of, and not with cache busting? So while we can have new pages automatically appear on a given date/time, we can't have scheduled changes to existing pages. Seems like a logical thing some clients would want to do. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
By way of example of how we currently ensure caches on templates are busted when a new entry is scheduled: As far as I can tell, there's not a way we'd be able to do this for changes to an existing Entry. |
Beta Was this translation helpful? Give feedback.
-
|
Unlike entry Post/Expiry Dates, which can be referenced in entry queries to ensure only live entries are returned, there are several actual database changes that need to happen when a draft is published. So to solve this we first need to implement a scheduling library such as https://github.com/omnilight/yii2-scheduling (#8847), and require that all Craft sites (or those that want this feature) set a cron job that runs the schedule every minute. Then we can create a scheduled job that checks for any drafts that are due to be published, and handles that. We’ll probably add support for entry publish events (#10858, #9170, #9394) and batched content releases (#8941) alongside it. |
Beta Was this translation helpful? Give feedback.
Unlike entry Post/Expiry Dates, which can be referenced in entry queries to ensure only live entries are returned, there are several actual database changes that need to happen when a draft is published.
So to solve this we first need to implement a scheduling library such as https://github.com/omnilight/yii2-scheduling (#8847), and require that all Craft sites (or those that want this feature) set a cron job that runs the schedule every minute. Then we can create a scheduled job that checks for any drafts that are due to be published, and handles that.
We’ll probably add support for entry publish events (#10858, #9170, #9394) and batched content releases (#8941) alongside it.