Currently, there is no way to output the workflow type from views. You can output the state, time, comments and many other things, but you cannot output the actual workflow name.
The reason I ran into this was that I wanted to show a list of pending workflow items, grouped by the actual workflow. If I have 5 different workflows and they all contain 'Pending' and 'Live' states, there is no way to differentiate between them.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 1996704_5_workflow_wid_field.patch | 1.61 KB | johnv |
| #1 | workflow-views_type_output-1996704-1.patch | 3.33 KB | zhuber |
Comments
Comment #1
zhuber commentedI have patched the module with this functionality, please review and test it when you have a chance.
I also tried create argument and filter handlers for the workflow type and came pretty close, but the table joins started to get a bit tricky for me. I may re-visit this depending on the level of interest from the rest of the community.
Comment #2
nancydruSQLSTATE[42S22]: Column not found: 1054 Unknown column 'wid' in 'field list'
Comment #3
zhuber commentedI think this just worked for my specific view now that I look at it. Since I was already loading the state field in my view it seems to find the wid column for me.
I'll revisit this when I get a chance, thanks for testing this so quickly.
Comment #4
nancydruThat is a danger we all face at times. It works for us, but "Drupalizing" it is more difficult.
Comment #5
johnvLike NancyDru says: I was very happy with the patch.. , until I stripped the view from all-but-most fields.
I did not encounter the error NancyDru mentions.
Please find attached a patch against latest -dev version.
I've explicitly renamed the 'workflow_types' table to 'workflow_type_map' (since that's the new name of the table), but the patch seems to work with both names.(??)
Comment #6
johnvIn version 7.x-2.x, there is more possibility to make a difference between workflows.
Please try that version, and reopen if it still does not fit your needs.