govCMS / GovCMS

Current Drupal release of the main GovCMS distribution, with releases mirrored at https://www.drupal.org/project/govcms
GNU General Public License v2.0
138 stars 40 forks source link

Add Scheduled Publish module to GovCMS #1130

Closed merylmccay closed 3 months ago

merylmccay commented 3 months ago

** What value does this module/package add to GovCMS?

We had this module in D7, but it never made it D8 because it didn't have a stable release for a very long time. We sometimes get requests from business areas to publish content out of work hours. This can be related to a ministerial announcement or the timing of an advertising campaign. At present we have no way of doing this and it means that we need to either negotiate a different publication date/time with the business area that falls within work hours, or they have to agree to pay overtime costs and we provide a staff member willing to work out of hours.

Reinstating it as part of the distribution would mean that we can simply schedule publication for the requested date/time and everyone is happy.

** Is the module Drupal 10 compatible?

Works with Drupal: ^8.8 || ^9 || ^10

** Please provide a brief outline of what this module does.

This module contains a field type for nodes and medias to update the moderation state of some contents via a cronjob.

** Who does this module benefit: [ ] end users [X ] content editors [ ] site builders [ ] themers [ ] developers

** How could you provide/replicate the functionality of this module using alternative methods, eg in your theme?

There is currently no other way to provide this functionality.

** If this module styles or alters HTML or JavaScript output, can the functionality be provided via the theme? What alternatives have you considered.

N/A

** What is the maintenance and support status of the module. Describe the issue queue activity.

Refer to https://www.drupal.org/project/scheduled_publish for details

** What permissions are needed to utilise the module (and are any new permissions provided by the module)?

Refer to https://www.drupal.org/project/scheduled_publish for details

** Does the module modify the database structure and/or store additional metadata on nodes or other entities? If so, why? What are the risks for future updates?

Refer to https://www.drupal.org/project/scheduled_publish for details

** Is the module designed to capture anonymous user data?

Refer to https://www.drupal.org/project/scheduled_publish for details

** Is the output of the module typically fully cacheable? Would the inclusion of this module potentially render pages uncacheable.

Refer to https://www.drupal.org/project/scheduled_publish for details

** What is your assessment of the quality of this module, the contribution history of the module's maintainers, and the uptake of the module within the Drupal community?

No idea, but we had this functionality in D7 so you must have some idea :)

** Additional information

thisisalistairsaccount commented 3 months ago

Hi @merylmccay have you or the team tried the Scheduled Transitions module? That is included in the distribution already - https://www.drupal.org/project/scheduled_transitions

I haven't yet had a chance to look at this module, but it does seem to align to what Scheduled Transitions can do and might fit the need and works with Content Moderation and works for blocks as well as content nodes.

If it doesn't, I'd be curious to know the differences between so we can compare.

StephenOllman commented 3 months ago

The SaaS does indeed have the Scheduled Transition module installed and available. It will allow content authors to draft new or existing content and then schedule a change to the moderation state (draft to published) at a given date and time. It is worth noting however that this functionality relies on the CRON process to run and trigger any scheduled transistions. I believe on a SaaS site CRON runs every hour (not neccessarily on the hour), so it can be tricky to get the draft content published at a specific time, but rather within a hour window.

Tuffy78 commented 3 months ago

The SaaS does indeed have the Scheduled Transition module installed and available. It will allow content authors to draft new or existing content and then schedule a change to the moderation state (draft to published) at a given date and time. It is worth noting however that this functionality relies on the CRON process to run and trigger any scheduled transistions. I believe on a SaaS site CRON runs every hour (not neccessarily on the hour), so it can be tricky to get the draft content published at a specific time, but rather within a hour window.

Our CRON runs at 14 minutes past every hour, as long as you know what time it is, it works well!

brett-sargeant commented 3 months ago

Scheduled Transitions works, it needs to be configured with a workflow and permissions. By default the cron job runs at a random time after the hour, which isn't useful for ministerial announcements.

However you can request a specific cron job to be set up in your SaaS site at x minutes past the hour to run every hour which will trigger the publishing process. The randomness is meant to assist with running process levels across the platform (IIRC) so you can't all choose the same minute for them.

Keep in mind however that with the various caching processes it can take 10 to 15 minutes for some changes to appear for people accessing the site.

As long as you are clear to the business areas on the timing it works.

thisisalistairsaccount commented 3 months ago

Thanks for the feedback on this everyone.

Scheduled Transitions in the distribution covers the need here. They both work in the same way in moving between states and both work with cron to achieve the outcome, notwithstanding the specific cron notes mentioned above.