Scheduler-process hooks incorrectly handle failures

Created on 27 September 2023, over 1 year ago

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

-

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇳🇱Netherlands spadxiii

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024