Scheduler not publishing

Created on 12 September 2023, 9 months ago
Updated 29 September 2023, 9 months ago

Drupal Core: 9.5.10
Scheduler: 8.x-1.4
Other known modules that might work with or affect Scheduler: Workflows, Workbench, Workbench Access, Workbench Menu Access

Problem/Motivation

Using a specific content type such as "Events", we first configure Events to be enabled for scheduling in its settings. In the Event creation or editing, we can set up a time to be scheduled.

We use Workbench workflows, so the options for Event would naturally be Draft, Scheduled, Published or Deleted when creating. When we select "Scheduled" and set up the time, it doesn't publish at the scheduled time. Permissions are enabled for all user roles.

Steps to reproduce

  1. Enable Workflows, Workbench, Workbench Access, and Scheduler
  2. Setup workflows in workbench
  3. Enable scheduling on a content type
  4. Schedule publishing

I don't really know where to begin to troubleshoot. There are no error messages. I have tried running cron between scheduling and scheduled time, but it didn't make a difference. I feel like I'm missing a step. I'm not sure where to begin troubleshooting.

πŸ’¬ Support request
Status

Closed: works as designed

Version

1.4

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States rraney

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

Comments & Activities

  • Issue created by @rraney
  • πŸ‡ΊπŸ‡ΈUnited States rraney
  • πŸ‡¬πŸ‡§United Kingdom jonathan1055

    I think #2977887: Nodes not publishing after Cron - conflict with Workbench Moderation β†’ might have some useful info. Are you using Workbench Moderation?

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

    No this isn't Workbench Moderation. I previously read through those issues but I'll take another look. I understand you see the word "Workbench" and naturally gravitate to that issue, but I don't know if Moderation has anything to do with these.

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

    As a reminder, we use Workbench and Workbench Access which, to my knowledge, are unrelated to Workbench Moderation. I decided to test the idea that Workbench Access is incompatible with Scheduler.

    I removed our "News" node from the Workbench Access workflow, so it should become unaffected by the Workbench modules. I set up a scheduled publishing of a news item and it published after the nightly cron job was run. Incidentally, it seems cron run is required between scheduling and the scheduled publishing (maybe common knowledge).

    I suspect this module is incompatible with Workbench and/or Workbench Access.

  • πŸ‡¬πŸ‡§United Kingdom jonathan1055

    Ah, that's good progress, now we are getting somewhere. I don't think there is an inherent incompatibility with Workbench because other users are using it alongside Scheduler, so my guess is that Workbench Access is causing the problem.

    we use Workbench and Workbench Access which, to my knowledge, are unrelated to Workbench Moderation.

    No, they are all part of the same family. If you look at the workbench_moderation β†’ project it links back to workbench β†’ but unhelpfully, the Workbench project does not have a forward link to Workbench Moderation.

    Incidentally, it seems cron run is required between scheduling and the scheduled publishing (maybe common knowledge).

    Yes, Scheduler uses cron to do the work. It does say this on the project front page in the 'Notes' section. Maybe that should be more prominent?

    Is it possible that you can try your same testing using Scheduler 2.0? Any chnages would have to be made there first any way.

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

    Thanks! I will try v2. I had no idea there were two different versions for D9.

  • πŸ‡¬πŸ‡§United Kingdom jonathan1055

    2.0 was only released three months ago
    https://www.drupal.org/project/scheduler/releases/2.0.1 β†’
    The big change is that it has plugin support for entities other than node, and you can now schedule media items and commerce products.

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

    I'd be happy to open another issue, but do you know why this is happening when I try to install 2 using composer?

    limestonedouglas@limestone [~/test]# composer require 'drupal/scheduler:^2.0' --with-all-dependencies
    ./composer.json has been updated
    Running composer update drupal/scheduler --with-all-dependencies
    Loading composer repositories with package information
    Updating dependencies
    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - Root composer.json requires drupal/scheduler ^2.0, found drupal/scheduler[dev-2.x, 2.0.0-alpha1, ..., 2.x-dev] but these were not loaded,likely because it conflicts with another require.
      Problem 2
        - drupal/scheduler_content_moderation_integration is locked to version 1.4.0 and an update of this package was not requested.
        - drupal/scheduler_content_moderation_integration 1.4.0 requires drupal/scheduler ^1.1 -> found drupal/scheduler[dev-1.x, 1.1.0, ..., 1.x-dev (alias of dev-1.x)] but it conflicts with your root composer.json require (^2.0).
    
    
    Installation failed, reverting ./composer.json and ./composer.lock to their original content.
  • πŸ‡¬πŸ‡§United Kingdom jonathan1055

    Let's not derail the original issue, it could be a simple fix, or could not be. Better to open a separate issue, thanks.

  • πŸ‡¬πŸ‡§United Kingdom jonathan1055

    I have followed the 'steps to reproduce' but you need to add more detail, as nothing goes wrong. "Set up workflows in workbench" does not explain enough, what exactly do you have to do to get the problem?

    I've turned the steps into a list in the issue summary. Can you add more detail please, then I can try to replicate the problem.

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

    Thanks. I'll try to provide useful information. Remember, I am running 8.x-1.4 because I was unable to update using composer.

    First, I made sure it's not working in my case. I enabled Scheduler for our News Story type. I scheduled a publishing time in the future. I set the time and option for "Publish State" to "Published". I set the workflow state to "Scheduled". The system only recognizes this as unpublished. I ran cron. I waited for the scheduled publishing time and it did not publish.

    Now more on how we set up Workbench Access. We use a "Department' access scheme. It relates to "Departments" Taxonomy. As an admin, I'm assigned to all Departments. In editing the Department Access Schema, I selected News Story as one of the allowed content types.

    We use a workflow called "Editorial". It has four states: Draft, Scheduled, Published, Unpublished. Each state is set up logically, where "Published" is the only published state. The "Scheduled" state has two transitions: Publish to Published, Unpublish to Unpublished. Publishing can go from Scheduled state to Published State. Unpublished can go from Scheduled to Unpublished.

    As for transitions, these are also logical. The one that relates here is "Scheduled". It goes from Draft, Published, or Unpublished to Scheduled state. The workflow itself is also applied to the News Story content type.

    I'm wondering if I'm missing something that connects Workbench "Scheduled" state and the Scheduler. I'm guessing technically the system considers a "Scheduled" node to be simply unpublished and the Scheduler module treats it as such. I don't understand where there might be a conflict. It's entirely possible I'm simply missing some setting.

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

    My apologies but there is another module called Workflows that may be the culprit. As stated above, we use Workflows. I thought this was part of the Workbench module. If I remove "News Story" from workflows, I believe Scheduler works.

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

    Quick update: I managed to install v2.0.1 as well as Scheduler Content Moderation Integration version 2.0.0-beta1. I ran my test for scheduling: Unpublish a news story, schedule a publishing time with published state, change Workflow state to scheduled, then save. Run cron. Wait for scheduled time. This did not work again, despite the new version of Scheduler and SCMI.

  • πŸ‡¬πŸ‡§United Kingdom jonathan1055

    Thanks for the information. I read it all, and one small comment of yours immediately popped out. In #12 you said

    I ran cron. I waited for the scheduled publishing time and it did not publish.

    and again in #14 you said

    save. Run cron. Wait for scheduled time. This did not work

    I think you may have mis-understood the concept of the cron job. If cron is run run the scheduled time then it will not do anything, that's by design. The content should not be published before the time specified. You need to wait until the scheduled time, then run cron (or better, set up an automated cron to run peridoically). Then on the first cron job the scheduled time the processing will be triggered and the content will be published.

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

    I definitely misunderstood about cron. I re-tested with the new version, running cron after the scheduled time.

    It worked! I believe the only issue was our testing. Thanks for your help.

  • Status changed to Fixed 9 months ago
  • πŸ‡¬πŸ‡§United Kingdom jonathan1055

    Hey that is great news!
    I think the Scheduler project front page could be improved with a few more hints about cron and trouble-shooting. If you have any suggestions on what we could add, let me know. If there was something that you assumed, which if we had explained on the project page or readme, to help, then it improves the experience for everyone.

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

    I appreciate that! The only thing I can think would be an explicit "How to Test" section. I'm not sure that anyone would ever need this, if I'm the first person to have an issue with this.

  • Status changed to Closed: works as designed 9 months ago
  • πŸ‡¬πŸ‡§United Kingdom jonathan1055
Production build 0.69.0 2024