I searched the issues already submitted for the workflow module, but couldn't find anything that matched my issue. I'll try to explain:
I created a simple workflow with a few states: new, approved, disapproved. I created two nodes, one in state approved and one in state new.
I created a view to show all the nodes including their workflow state. However, my view returns 4 results. The two nodes I created are duplicated: once with state new and once with state approved. When I remove the workflow: state from the fields in my view, eac node is only shown once.
Attached are some screenshots to explain.
| Comment | File | Size | Author |
|---|---|---|---|
| notesarenotduplicatedwhenstatenotshown.JPG | 10.29 KB | kloosm | |
| nodesareduplicated.JPG | 19.39 KB | kloosm |
Comments
Comment #1
kloosm commentedAnybody who can help me with this?
Comment #2
kloosm commentedOK found it: this was caused by problem with workflow owner module, described here: http://drupal.org/node/226972
Comment #3
rares commentedI'm having the same problem with workflow 6.x-1.0 and views 6.x-2.2.
When I add Workflow: previous comment to the fields, I get an entry in the view for each different comment I entered, not just the most recent one. Does anyone know how to avoid this duplication?
This might have more to do with views than with anything else, but any help is appreciated.
Comment #4
rares commentedchanged title, because this pertains only to the comment fields.
Comment #5
voidberg commentedI have the same issue. Any news on that? I am not using workflow owner, just views and workflow.
Comment #6
a_c_m commentedsame as #5 - getting double results, even with distinct turned on, on the view.
Comment #7
petrescs commentedSame here for workflow 6.x-1.1 and views 6.x.-2.5
Comment #8
tpainton commentedI am having the same issue. When the field Previous Comments is used, there are duplicates because the node has been in that workflow with more more than one comment. Blanks are essentially a comment with no characters. What is REALLY needed is a field "Workstate Current Comment". I think this is essentially what all of us are looking for. This SHOULD get rid of the duplicates and it's not really a bug if the field is designed to list ALL of the previous comments.. Not just the comment previous to the current. I'm not sure when one would use it as a better field would be "All Previous Comments."
When listing all nodes of a certain workstate, it sure would be nice to list the comment associated with that workstate. At present, I don't think there is a way to do this.
If I am wrong here, please, someone let me know. I really need this functionality.
Thanks.
Comment #9
tpainton commentedOne work around I thought might work would be to add an argument "Current State", then use php to return the current state and therefore, only list the comment of the current state.. I have no idea how to do this with php.. Love help, or a new field :)
Comment #10
gtothab commentedI'm having the exact same issue. Anybody know of a fix??
thx
Comment #11
restyler commentedAs "distinct" modifier doesn't work for me in views, here is the quick workaround I used to get the most recent workflow comment:
- Install http://drupal.org/project/views_customfield module
- Create a php custom code view field for your view
- Insert the following code inside textearea:
Comment #12
lisacabisa commentedThanks restyler -- that's perfect!
I adjusted your query a bit to get the immediately previosu workflow state:
Like a charm. :)
Comment #13
justintime commentedWhile the above workarounds work for fields, I need to have a sort based on the now non-existent 'current time' field. I posted the beginnings of a fix for this issue at #426800: "Workflow: Previous time" views field results in duplicate nodes (D6), I'd appreciate any input.
Comment #14
justintime commentedI just posted a patch for this bug on #426800: "Workflow: Previous time" views field results in duplicate nodes (D6) - please post if it works for you.
Comment #15
aiphesHi
i've the same trouble when i would to customize the basic workflow summary view...so when i add a field to display comments, nodes are duplicate...i would to know if someone have fixed this for the later version ?
thanks
Comment #16
johnvComment #17
johnvIMO this is fixed. In 6.x-1.5, the "Workflow:current state/time/comment" is added. You can use "Workflow: previous:..." to create a history of your nodes.
Comment #18
johnvSee also #2147535: Add a "Last transition" views filter