Hello,
I want to list a bunch of nodes using views and let the user change the state of that node right in the views.
So I made a View, added the proper fields, added Content: workflow
and set the Formatter on Workflow
.
First issue:
I thought now it should just work, the action buttons renders at the bottom of view but when you click on it, nothing happens, when I look at the code there's no Form
tag in HTML. so that must be it.
Here's a screenshot (please don't mind the language)
Second issue:
As you can see there are some extra commas rendered before the action buttons of workflow, when you inspect and look at the code you see the following:
<div class="views-field views-field-field-workflow">
<div class="field-content"><div class="workflow-form-container form-wrapper form-group" id="edit-workflow">
<input type="hidden" name="workflow_hid" value="0">
<input type="hidden" name="workflow_comment" value="">
</div>,
<input type="hidden" name="form_build_id" value="form-mnuhUyxXv7TQz984BCxTsI7a1VvIsaTrKAcJSUQU8-Q">
, <input type="hidden" name="form_token" value="4GroanwNqYhS-EEKUj3meTEdGazIWidiPzrnJkAPe9U">
, <input type="hidden" name="form_id" value="workflow_transition_form_node_6_51">
, <div class="form-actions form-wrapper form-group" id="edit-actions">
<button class="form-save-default-button btn btn-default form-submit" id="edit-workflow-5" name="op" value="فروخته شد" type="submit">فروخته شد</button>
<button class="btn btn-default form-submit" id="edit-workflow-2" name="op" value="غیرفعال" type="submit">غیرفعال</button>
<button class="btn btn-danger form-submit" id="edit-workflow-3" name="op" value="حذف آگهی" type="submit">حذف آگهی</button>
<button class="btn btn-default form-submit" id="edit-workflow-4" name="op" value="انتشار" type="submit">انتشار</button>
</div>
</div>
</div>
Which I assume is the separator set for workflow comment, label, current state and etc in code which when the user doesn't have the permission leave it as just a ","
Third Issue:
Well I ended up using VBO to make the action buttons to work, I added Bulk operations: Content
field, to the views, excluded it from display, and checked Change workflow state of post to new state
as the bulk operation and it ended up working in a weird way!
- I'd like to know why it's not possible to just render
Content: workflow
as a form so it doesn't require the VBO to finish the job. - What are those extra Commas
Thanks a million for your time and efforts to save us the noobs, Johnv.
Comment | File | Size | Author |
---|---|---|---|
#2 | workflow-views.jpg | 114.83 KB | doxigo |
Comments
Comment #1
doxigo CreditAttribution: doxigo commentedComment #2
doxigo CreditAttribution: doxigo commentedComment #3
johnvad 1) Indeed, it should just work. if not, perhaps it went broken in the last version(s).
ad 2) the comma's in the Views Formatter are indeed there. The formatter on a 'normal' Node View or Node Form are OK. I do know that the comma's are there, but don't know how to get rid of them :-( I was hoping for the crowd to solve this puzzle.
ad 3) need to test this.
Comment #4
doxigo CreditAttribution: doxigo commentedThanks John for the quick respond, so is there anyway to make sure that the first issue works ? I tested it against the latest stable version as well, still the same problem.
second issue is just weird!
third one is just a workaround I guess to get a Form tag in code.
I try to look into this on my own as well, I keep you updated if I end up with any solutions.
Thanks.
Comment #5
doxigo CreditAttribution: doxigo commentedI end up with jQuery to clear out the Commas:
as for lack of
form
tag inContent: workflow
field in views, no solutions yet!Comment #6
johnvIs this of use ? #2510958: Workflow Transition Form very difficult to theme
Comment #7
doxigo CreditAttribution: doxigo commentedNo I doubt it, I will use that to help me theme it easier, but it's not related to my issues unfortunately.
Comment #8
johnvComment #9
ph7 CreditAttribution: ph7 commentedI experienced the same thing.
In my use case I want to include entityform fields in a workflow. I am able to change workflow states via the entityform submission page, but views gives me more out-of-the-box flexibility. In case of the entityform submission page the workflow widget is wrapped in a form element. Not so with views. Ergo, I'm unable to change workflow states in a view.
I found this post on how to programmatically add form elements to views.
I will further explore this in an effort to glue together these awesome modules.
Comment #10
ph7 CreditAttribution: ph7 commentedGot it!
I noticed that the approach in the post as described in #9 is already implemented in the workflow_views module, so I turned my attention back to views configuration.
I had not previously noticed that entityform provides a field template setting under Configure Field > Style settings. When I ticked this option I was able to change the workflow state from views! So, changing workflow states from views should work if the 'source module' provides a views form template.
Comment #11
adamtong CreditAttribution: adamtong commentedi have same issue too! any solution for 1 and 2?
Comment #12
adamtong CreditAttribution: adamtong commentedoh...#10 is fixed my issue..just notice it
Comment #13
johnvI quess this is fixed.
If not, please open an issue for each problem separately.
Comment #15
johnv