Nodes not publishing after Cron - conflict with Workbench Moderation

Created on 6 June 2018, over 6 years ago
Updated 30 March 2024, 9 months ago

Installed scheduler on a d8 site and enabled publishing and unpublising on the content type. I create a node and set the date to 1 min in the future and nothing happens. If I run cron before the publish time hits, nothing happens or shows up in the logs.

If I run cron after the published time, nothing happens, but the schedular module does show a log that says "Campaign: scheduled publishing of test." but yet my node remains unpublished.

I used this module in D7 and what I was doing worked so not sure what is going on here.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States rondog469

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States rraney

    I don't have Workbench Moderation installed, but I do have Workbench and Workbench Access. Our scheduling does not work and this issue is the closest I've been able to find to our own issue. Are Workbench and Workbench Access related to Workbench Moderation in any way? Is it the same family of modules?

  • πŸ‡ΊπŸ‡ΈUnited States khaldoon_masud

    I solved this issue by installing the module https://www.drupal.org/project/advanced_scheduler β†’ , and implementing a custom hook:

    /**
     * Implements hook_action_info_alter().
     */
    function module_name_action_info_alter(&$definitions)
    {
    
      // Scheduler module does not work with the workbench moderation module, because scheduler calls the publish_action and unpublish_action plugins
      // which are overwritten by workbench_moderation module (lookat workbench_moderation_action_info_alter)
      // Prevent/revert the overwrite with the below code, since advanced_scheduler module is capable of publish/unpublish moderated content.
      if (isset($definitions['node_publish_action']['class']) && $definitions['node_publish_action']['class'] == ModerationOptOutPublishNode::class) {
        $definitions['node_publish_action']['class'] = PublishAction::class;
      }
      if (isset($definitions['node_unpublish_action']['class']) && $definitions['node_unpublish_action']['class'] == ModerationOptOutUnpublishNode::class) {
        $definitions['node_unpublish_action']['class'] = UnpublishAction::class;
      }
    
      if (isset($definitions['entity:publish_action:node']['class']) && $definitions['entity:publish_action:node']['class'] == ModerationOptOutPublishNode::class) {
        $definitions['entity:publish_action:node']['class'] = PublishAction::class;
      }
      if (isset($definitions['entity:unpublish_action:node']['class']) && $definitions['entity:unpublish_action:node']['class'] == ModerationOptOutUnpublishNode::class) {
        $definitions['entity:publish_action:node']['class'] = UnpublishAction::class;
      }
    }
    

    You may need to modify module weight, so above hook runs after workbench_moderation_action_info_alter

Production build 0.71.5 2024