Active
Project:
Field Conditional States
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Mar 2014 at 15:42 UTC
Updated:
13 Mar 2014 at 21:33 UTC
Jump to comment: Most recent
Comments
Comment #1
Tobias Xy commentedYes, the states API supports all form elements, but a user role isn't a form element. So in my opinion this isn't the kind of thing we want FCS to do.
I actually think you're looking for a module like Field permissions. Please correct me if I misunderstood your intention.
Comment #2
mustanggb commentedField Permissions has no ajax (aka States API) support, so no it's not what I was looking for.
What I am looking is GUI support to add #states driven selectors, with a bit of clever handling that falls back nicely when javascript is disabled.
Perhaps I can post a bit of code that explains it better.
Comment #3
mustanggb commentedOkay, something along these lines:
Comment #4
hass commentedThat looks like a job for field permission. Role membership does not change at form selection, too.
One thing that may be useful is that a field becomes required for one role, but not for others... But hiding fields is different situation I would only toggle with permissions and not with states.
Comment #5
Tobias Xy commentedActually on the user edit page the role can change. It is a form element there, but not a "normal" field.
How should we handle these kind of elements in general?
In my opinion it would be nice to include them, but thats probably too much pain, because there isn't a unified way of accessing them (at least I don't know it) and hook_field_extra_fields/field_info_extra_fields isn't providing the information we would need to work with extra fields (additionally the user roles aren't exposed through this hook).
We could add special handling for each kind of entity or at least for nodes (e.g. node title) and users (e.g. roles), maybe as a submodule. How do you think about that?
Comment #6
mustanggb commentedPerhaps the ultimate solution would be to turn them into normal fields in core.
But until then I think you're right that they'd require special handling and that it'd be really good if we could include them.
Also the submodule idea sounds like the way to go because it'd keep the main normal real fields code clean, whilst still having the functionality that users have been asking for.
Comment #7
hass commentedI'm not sure how much work this is, but first of all we should really get a final 2.0 out and than look for possible future features like these here. Development does not stop after 2.0 release :-).