Form mode is a nice feature; but it is completely useless in many cases.
Here is a use case: I have a content type (Film) with a lot of fields and I would like to use the form modes to split the data to be encoded in several forms.
Ex: Technical form, Artistic form, Financial form,...
I have other content type that do not share this splitting. For example, the "company" content type do not need to be split into "Technical form", "Artistic form",...
I other words, by accumulating several form modes and several content type, the UI is quickly invaded by them.
Hiding those forms by using permission is not a good idea for several reason:
1-If all members are administrator, you can't hide the forms
2-The permissions can only be set on the entity level (I can not "hide" a form mode for a content type, but only for all the nodes)
3-Permissions is a tool to restrict access to a functionality, this is not a tool to remove a functionality
This is why, I think that the proper way to manage the form modes is the following:
1-All the form mode local task and local action are disabled by default
2-We need a setting page that list all the entities with their bundle. For each of them, there is a check box to enable the local task and a second check box to enable the local action
3-The permissions granularity should be set at the bundle level and only for the enabled form mode (to not overload the UI)
4-All disabled form modes have access=false (no need to add them in the permission UI)
I think that by doing this, we will have a much more clean UI and a very flexible form mode manager.
Let me know your thought.
| Comment | File | Size | Author |
|---|
Comments
Comment #2
duneblregarding the following:
In fact, I think half of the job is already done; if you go to :
/admin/structure/types/manage/my_content_type/form-display
/admin/structure/contact/manage/personal/form-display
/admin/config/people/accounts/form-display
...
Under "Custom display settings" you can check the display form you like to use.
We could use those checked display form, to create
-Local tasks
-Actions
-Permissions list
In other word, if a display form is checked, a permission, a local task and an action should be created.
If we want to fine tune, on a next stage, we can add 2 check box at the same place for the Local task and for the actions.
This means a total of 3 check box:"Use display form, "Create local task for it" and "Create action for it".
Note1: the permission is automatically created when "Use display form" is checked
Note2: "Create local task" and "Create action" are only enable when the "Use display form" is checked
Comment #3
woprrr commentedHi @DuneBL,
What are you mean about "Do not use permission for removing functionnality" ? nothing are remove by permission in Form Mode Manager we create one new operations for all content entity. Only tabs / action / operation displayed are filtered by permissions that is the drupal way to hide / show element to UI.
I think your feedback for action (flood) are right for admins user, i think the real discuss is that "Found solution to display an action button with secondary actions" and the problem is solve. That is more an UX problem not an code or feature misstake.
For taks same problem ! but the functionallity already exist to defined second tabs task we need to seen the Devel implementation I think that is a good base.
Yes now in #2834768: Route alteration refactor a part of problem is solve, an local / action tabs are displayed ONLY if that is enable in bundle ui that limit few problematic cases and that is more logical.
Yes ! this is an redondant problem... that can be easily fixed by refactor in #2834768: Route alteration refactor because now we have an more clear mecanism to get active display by configuration compare like Display mode implemented in 8.2 :)
ATM we have an filter by entity type
for entity bundle feature we can have
But my problem today is that :
"We do have an Form Mode Manager config page with permissions / form display possible display or only provide an implementation and users do correctly configure her forms / permissions with common tools provide by Drupal 8".
Comment #4
woprrr commentedComment #5
woprrr commentedHi @DuneBL,
Now we can continue our reflexion about it. I would like talk you more about this subject. Actually I have re-designed all module and the last part to refactor/re-enabled are permissions and UI control. Actually we have resolve all problemes of Interface Flood and possibility to say if a form-mode are used by configuration per bundle. I guess we haven't any problems now. But we need to re-implemented all permissions to restrict all visibility of form-mode. We have few options like : "Add permission to use form mode" that seems to be the Drupal common approach (and that is really simple to implement with two way (Handler access custom) or access routes). To filter and show modes/task/local action. What do you think about it ?
I am fully okay with your idea to create a Configuration page to control action/task appear in UI. But that does a part of an other Feature request :)
Comment #6
woprrr commentedNow fixed onto beta-2 refactor/re-design of API. Feel free to re-open if you have more feedback.