There are several issues, that complain about 'duplicate nodes' when showing/selecting a previous comment/state/time.
IMO the current system behaves correct: it shows all previous states, not only the last one.
To fulfil the requests, we need a 'last transition', that selects that most recent transition from 'workflow_node_history'.
It should disregard the transitions that only add a comment (and do not change the state).
Then, one can filter on 'current status/comment/time' and last status/comment/time.
This also serves Workflow Field, since table {workflow_node} is not used there.
Perhaps we should rename 'previous' to 'historic' or 'logged' or... (need some native English speaker for that..)
Comments
Comment #1
johnvThe basis already exists: $data['workflow_node_current']['table']['group'].
It generates a join between {workflow_node} and {workflow_node_history}.
ATM it only supports 'last comment'.
More functionality can go in.
Can we skip the join for workflow_node, and just select highest 'hid'?
This makes it compatible with Workflow Field, too.
Comment #2
johnvThis commit adds a 'Transition: old state', to complement the existing 'Transition: new state'.
Comment #3
johnvAnd this commit
adds all fields for 'current status'/'last transition' that were in 'history', too.
"Workflow: current" shows the data from the latest transition with status change. (If you have multiple comments without status change, you must use "Workflow: history".)
Comment #4
johnv