Actually, the Workflow module allows same state transitions, but no historical records are saved in that case.
For our project, when a node is in a certain workflow step we want to be able to load data and other things (i.e. files), saving a row in the workflow transition history.
We are working on a patch for the Workflow module that adds a configuration setting to specify if the same state transitions have to be logged in history.
Regards,
Michele
Comment | File | Size | Author |
---|---|---|---|
#2 | log_same_state_transitions_in_history-2903779-2.patch | 5.7 KB | mithenks |
Comments
Comment #2
mithenks CreditAttribution: mithenks at bmeme commentedHere is a possible implementation.
Please take a look and review it.
Regards,
Michele
Comment #3
johnvThere should be another issue with the same feature request. perhaps it is already closed. I cannot find it again.
The general code pattern is:
So instead of adding a new setting, you can use the following facility:
by implementing
function hook_workflow_comment_alter(&$comment, array &$context)
.There, you can make your custom evaluations. See also the file workflow.api.php for code examples.
Perhaps this 'feature' could be added to the Documenation pages.
Comment #4
johnvSorry, I have to mark this a a Won't fix. I hope the above workaround works for you.
Your patch did help me to identify the attached child issue, so thanks for that.
Comment #5
robertom CreditAttribution: robertom at bmeme commentedI johnv,
inside function hook_workflow_comment_alter(&$comment, array &$context) we can solve the problem only by adding a fake comment.
I have open another issue that should be a good path for us #2987772: Check for attached fields on WorkflowTransition::isEmpty() method