Hiding view only fields when editing
| Project: | Workflow Fields |
| Version: | 5.x-1.x-dev |
| Component: | Miscellaneous |
| Category: | feature request |
| Priority: | normal |
| Assigned: | kratib |
| Status: | closed |
Jump to:
I have a custom node type with a large quantity of fields, each of which are only to be editable in certain stages of a workflow, and available to view only in stages after they have been edited - e.g.
Fields:
Title
Tested
Tested by
Test Date
Faults Fixed
Engineer
Engineering Date
Notes
Stages:
Creation
For Testing
For Engineering (Fixing)
For Soak Test
For Sale
The fields are in a fieldset, given weights from -10 to 9. When a node is in For Testing, only Tested, Tested by, Test Date & Notes are set to be visible and editable. Faults Fixed, Engineer, Engineering Date are set to be not viewable or editable. When a node is in For Engineering (Fixing), Tested, Tested by, Test Date are to be visible but not editable, Faults Fixed, Engineer, Engineering Date & Notes are visible and editable. Finally when in For Sale, all fields are visible but only Notes is set to be editable.
When editing a node in For Engineering (Fixing), the non-editable fields Tested, Tested by, Test Date appear above Title (I'm guessing because they are given a weight lower than -5) and not in their assigned fieldset with the editable fields. A similar situation appears in For Sale - the viewable but non-editable fields are arranged outside their fieldset but according to their weight. The fields appear in the correct position when viewing. How can I either:
- Make the non-editable but viewable items be hidden when editing a node
or - Make the non-editable but viewable items appear in the fieldset
I personally would prefer the former, but would take the latter if necessary :)

#1
It's definitely easier for me to hide the fields than to place them in a fieldset :-) So I'll add a setting to that effect in the admin screen and let you know when it's done.
#2
Cool, very much appreciated!
To me, having the view-only fields invisible when editing makes more sense - it helps focus the user on what they need to do for that particular stage and prevents overwhelming them with fields.
#3
Committed to D5 and D6-dev. Please wait 12 hours for Drupal.org to refresh the releases.
Workflow Fields has now a settings screen in Site configuration to allow turning on or off the option of hiding read-only fields in the editing form.
#4
Thanks for this and apologies for not responding earlier - was caught up in other areas and only came back to check today. If there are any issues I'll let you know but none so far.
Great job :)
#5
Automatically closed -- issue fixed for two weeks with no activity.