After a scheduled transition executes, a notice log entry is created (type: content) for the transition on every cron run, rapidly filling the log with notices for transitions that have already occurred. For example, a scheduled unpublishing of a blog post will trigger a notice log entry on the date/time it is unpublished, but then every time cron runs after that a new notice is generated for the already unpublished node.
Is there a way to stop this?
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | workflow-scheduled-transition-log-entries-repeating-1357406-6.patch | 993 bytes | Anonymous (not verified) |
Comments
Comment #1
douglasmiller commentedI am seeing this is my logs as well. Here is a SQL query that I ran to show me all entries for a particular node in a day:
and this is the result:
Comment #2
Anonymous (not verified) commentedAlso on 7.x-1.2+20-dev
Comment #3
johnvComment #4
Anonymous (not verified) commentedI noticed that one case that this happened was when I accidentally scheduled node to change to it's current state. Maybe that shouldn't be possible at all? :)
Comment #5
johnv@pikku-h , perhaps you can test the following:
In function workflow_execute_transition(), the transition is not executed in a not-allowed situation, for instance when old_sid = new_sid.
The last lines of that function are:
Perhaps this line must be repeated in all/some of the not-allowed situations.
Comment #6
Anonymous (not verified) commented@johnv, indeed adding workflow_delete_workflow_scheduled_transition_by_nid() to other cases than successful scheduling is needed.
Attached is a patch that removes scheduling if node is scheduled to change state that is the same the node currently is (ie. changing state draft -> draft). Fixed also that scheduling comment is still added to node scheduling history.
Comment #7
johnvThanks for the patch.
Do you have an opinion about the other not-allowed situations?
Comment #8
Anonymous (not verified) commentedI don't have time to go through those ATM but I guess that all of them should be clearing any scheduled transitions. Otherwise this just happens again at next cron run.
It also might be good idea to move these validations from workflow_execute_transition() to for example workflow_tab_form_validate(). This way there would not be "invalid" schedulings.
Comment #9
johnvWe'll just leave the other exceptions untouched for now. They might be configuration errors in a live site, that must be corrected by admin.
The patch is committed here.
Comment #10
chicagomom commentedThank you!