Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Event Scheduler Publish

Security covered Under active development 6 sites

Part of the Event ecosystem · 20 projects

This module allows you to schedule the publishing and unpublishing of any content entity type by adding specific date fields. It leverages the Event Scheduler module to handle these actions based on defined publish and unpublish times.

Although the ability to publish and unpublish exists in the Scheduler module, it works with any content entity.

This module allows you to schedule the publishing and unpublishing of any content entity type (node, term, or even path_alias (theoretically), plus any custom entity you might create - as long as it has a "status" property and the other fields listed below).

In addition it does this using the generic Event Scheduler module that uses Symfony events rather than hooks.

How to use

Assuming you have this module installed and enabled all you have to do is add either or both of the following fields to the entity or bundle:

* `field_scheduled_start`
* `field_scheduled_end`

These must be date fields storing in the `Y-m-d\TH:i:s` format. They can be just for the "date" part, in which case it will be assumed to be the start of the day for the publish, and the end of the day for the unpublish.

The timezone used will be the one belonging to the creator of the entity.

If the publish date/time is already past, the entity will be published immediately. Similarly for the unpublish date/time.

Events

You don't need to do any coding for this to work but for developers there are two events issued once the action has been performed:

  • EntityPublishedEvent when an entity has been successfully published.
  • EntityUnpublishedEvent when an entity has been successfully unpublished.

If you want to carry out other actions you will normally intercept those two in an event subscriber. Those two events are both delayed events and will be launched after the rest of the page has been built and sent to the browser.

If an entity is deleted while events are pending, those events are automatically removed.

And that's all there is to it.

Important note

No module of this type can guarantee publishing at an exact time because scheduled events depend on when "cron" is run. The more frequently it's run, the closer to the correct time the publish/unpublish will be.

Ask your assistant about Event Scheduler Publish

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Mar 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
2.2.0-rc4 Pre-release 9–10 Apr 9, 2023
2.2.0-rc3 Pre-release 9–10 Apr 8, 2023
2.2.0-rc2 Pre-release 9–10 Mar 5, 2023
2.2.0-rc1 Pre-release 9–10 Mar 5, 2023