I have a document workflow where a Draft or document gets sent to an editor. If the editor sends it back to Draft for rework then Views correctly adds it to the "Returned from editor" display (current state: Draft, previous state: Editor review).
The thing that is not working as it should is the document also reappears in the "New Drafts" display (current state: Draft, previous state: & Draft). I would expect that as the documents previous state was "editor review" it should be excluded from that.
System:Workflow 6.x-1.4 Drupal 6.17, php 5.2, mysql 5.1 Views 6.x-2.11
ps Thanks for a great module!
Comments
Comment #1
Mark F commentedOn looking at the database tables, it appears that the filter is looking to see if the node has EVER had the previous state. I feel that, at least in Views, that there should be an option to choose whether I want to filter by "ever had state" or "most recent state". The workflow history table does have a timestamp. Unfortunately, I'm not a coder, but more than happy to contribute documentation!
Comment #2
kswan commentedI just ran into this same issue with a "Previous State" filter. I am seeing that the Views query is filtering by workflow_node_history.sid instead of workflow_node_history.old_sid.
Comment #3
kswan commentedI confirmed this issue is still in 6.x-1.5.
Here is a patch that resolves the issue of the "Previous State" filter using the sid field instead of the old_sid field.
There is probably a more elegant way to do this, but this is at least a good starting point.
Comment #4
christiaan_ commentedFirstly thank you for a great module. The only thing that does not seem to work is the "Previous State" field and filter in Views.
I tried the Patch in #3, but had no success. The Previous State is incorrect. It displays "Creation" as the previous state for all previous states on different nodes even if you change the workflow.
Any ideas ?
Comment #5
johnvReassigning to other component.
Comment #6
johnvReassigning.
Comment #7
johnvSince a patch is attached, this is Needs review.
D6 is not maintained anymore. I'm reflecting this in the title, and leaving this open for other users.
Please see #2147535: Add a "Last transition" views filter for another approach.
Comment #8
johnv#2147535: Add a "Last transition" views filter now has a committed fix.