I have two usecases when expired transitions are not removing from DB and still stuck in cron queue.

1. If you scheduled not to get state A on some date, but someone brings a node to this state (A) before scheduling time comes.
2. You put a node to state A, and set transition in two days to state B. But someone pushed it to state C before of that.

My patch allws to remove such expired transitions during a cron run.

Please, review.

CommentFileSizeAuthor
workflow_pib.patch1006 bytesneochief

Comments

jvandyk’s picture

Committed part of this patch. I will revisit it for the other part.

jvandyk’s picture

Version: 6.x-1.0-rc3 » 6.x-1.0-rc4
Status: Needs review » Needs work

I don't think the first part of the patch does what you intend. Deleting scheduled transitions there would have the following effect:

1. Joe sets a node to go from State B to State C in the future using scheduled transitions.
2. Betty sees a typo and edits the node but does not change the state.
3. Joe's scheduled transition is wiped out.

neochief’s picture

Status: Needs work » Needs review

In my case first usecase, Betty sets node to State C (same as Joe schedulled). If she sets State to N, the first part of the patch is not launching because of predicated expression
if ($old_sid == $sid) {
which is already in module's code.

(By the way, sorry for unclear description. I've read it now and can do some corrections: If you scheduled not to get state A on some date, but someone brings a node to this state (A) before scheduling time comes.)

jvandyk’s picture

Version: 6.x-1.0-rc4 » 6.x-1.x-dev

Sorry, I am a little dense. Can you please give me a verbose explanation of what the problem is and exact steps to reproduce it, then present your patch and how it solves that problem? Test your changes against the dev snapshot.

neochief’s picture

Status: Needs review » Fixed

Darn holidays tied my tongue :)

As I see from dev snapshot, all of my changes are included (the first part got there before, I think). So, there's nothing I can say more, but to mark this issue as Fixed. Thanks, John.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.