Needs review
Project:
Workflow Required Fields
Version:
6.x-1.0
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 Jan 2008 at 00:54 UTC
Updated:
8 Sep 2011 at 12:19 UTC
Jump to comment: Most recent file
Comments
Comment #1
adshill commentedIf I understand, this means showing a required asterisk in red (*) next to each field required to get to the next workflow state. I would pay for this and I think its not so hard. $200 bounty for it if you contact me in the next 24 hours!
Comment #2
HairMachine commentedIf you comment out the entirety of the wf_required_fields_workflow hook function then this module appears to work a lot more like what I expected. What I had expected was, you selected which workflow states are set to have 'required' fields, and this means that the any content which is in that state requires those fields in order to be submitted. The default behaviour of the module, however, prevents the saving of a node if the *next* state has required fields that are not completed in the current state.
Removing the implementation of hook_workflow solved this issue for me, but I haven't tested it completely so do so with caution. It's also horribly bad practice of course, but I was in a hurry! :)
Comment #3
gaëlgThis patch works for my basic needs. If the field is not currently required but would be required in other workflow states, it displays an orange asterisk and the list of the states requiring the field.
It uses the #post-render attribute to alter the rendered content of the field. This is probably not so good to insert html tags next to the rendering, so if you see some better way of doing things, let me know.
I'm not very comfortable with Form API, it may not work for complex cases like fieldgroups.
Comment #4
mudd commentedAlso, if ever a role-base exemption is added (I tried cck_required_by_role but the magic is not happening for fields required by this module), then it would be nice if message for that next-state transition requirement is adjusted.
EDIT:
Really neat would be to disable those states in the workflow widget unless the field is populated.
I patched with #3, but I don't want to show the end users all of the approval states, so I removed implode(', ', $states) -- I'm still trying to figure out how to detect the next state in the workflow and use javascript to disable that workflow radio button...
Comment #5
gaëlgNext state detection seems to be done in this function.