This is something we're running into in a big site with lots of imports and other actions happening outside of manual editing of nodes. Somehow nodes can get into a state which saves a new revision, but does not fix the current state it is in. So next cron-run, it saves another revision with the incorrect state.

Problem/Motivation

When there's a failure, the scheduler-hooks does not revert the state back to the previous state like the scheduler-module does with the timestamp-field.

Steps to reproduce

Create a node which is published and has an unpublish-on and -state set. Set the node to that state elsewhere (could be batch update in a view, or manually in database) and run the scheduler:cron.
The node now has an unpublish-on value but no unpublish_state value.

Proposed resolution

Move the code that clears out the state-value inside the try/catch inside the hooks and add a case-check for then it should (un)publish to the current state.

Remaining tasks

-

User interface changes

-

API changes

-

Data model changes

-

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

SpadXIII created an issue. See original summary.

jonathan1055’s picture

Version: 2.0.0-beta1 » 3.0.x-dev

Thanks @spadxiii for the MR.
Can you check what the behavior is on the 3.x branch, and open a new MR there. When complete, we can use MR49 for back-porting to 2.x

bkosborne’s picture

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.