- Issue created by @solotandem
- Merge request !28Issue #3436808 Modify form structure and use core 'states' JS for each access plugin. β (Open) created by solotandem
- Status changed to Needs review
about 2 months ago 5:00pm 19 April 2024
The alterations to the field config edit form add the access type options to the form array beneath a 'field_permissions' key
$form['field']['field_permissions']['type']
while the form elements of the custom access plugin (the only plugin in the module with such) are not so parented.
$form['permissions']
Also the former include an unnecessary 'field' key in the array structure.
The custom JS attached by the custom access plugin can be replaced with core 'states' JS. And the latter can be used to control visibility for all access plugins (including those not defined by this module). (Issue 3097655 recommends the same but only deals with the custom access plugin and then makes changes to that plugin. This is not future proof against additional access plugins from this or other modules.)
The CSS in the 'field_permissions' library is NOT used by the form elements added by the custom access plugin.
IMHO the form elements for field permissions should NOT display before those for the field settings, as the former are ancillary to the 'field configuration'.
Remove the 'field' array key.
Add 'field_permissions' key to form elements of each access plugin and invoke states JS.
Remove 'field_permissions' library from the form elements added by the custom access plugin.
Adjust the 'weight' of the form elements added by this module.
None.
None (other than moving the form elements down on the form).
None.
None.
Needs review
2.0
Code