Problem/Motivation
In 8.2.x, when a field is disabled under "Manage display" for an entity, the label display settings still appear to be configurable. However, the user's selection is not actually stored anywhere and therefore lost.
(gif provided by @alexpott)
In 8.3.x following #2796581: Fields must store their region in entity displays, this also happens for the formatter selection.
This bug might not appear that impactful at first since it's for configuring fields that are not displayed, but the problem is that this also impacts the data when fields are moved between disabled and an enabled region, which results in lost input that the user did not expect.
Steps to reproduce
- On
/admin/structure/types/manage/article/display
, move the Tags field to disabled and save the form. - Change the "Label" or "Format" options for the Tags field and save again. The change is not actually saved.
Proposed resolution
Do not show field settings that are not saved for disabled fields.
The solution will need to support all three of tabledrag, non-tabledrag, and no-js workflows for the form.
A different solution would be to actually store the configured settings for disabled fields, but that would require a data model change as well, and as @alexpott points out there is also an advantage to simply having fewer options on this form.
Remaining tasks
TBD
User interface changes
TBD
API changes
TBD
Data model changes
TBD
Comment | File | Size | Author |
---|---|---|---|
#26 | disabled-form-fields-2.png | 33.33 KB | capysara |
#26 | disabled-form-fields-1.png | 24.99 KB | capysara |
#11 | 2822411-11.patch | 1.41 KB | swentel |
no_unsupported_options.jpg | 55.55 KB | xjm | |
disabled_field_format.png | 62.31 KB | xjm |
Comments
Comment #2
xjmComment #5
xjmComment #7
capysara CreditAttribution: capysara commentedI'm going to triage this.
Comment #8
capysara CreditAttribution: capysara commentedComment #9
capysara CreditAttribution: capysara commentedI was able to reproduce this in 8.4.x locally. Following steps in the summary:
Steps to reproduce
On /admin/structure/types/manage/article/display, move the Tags field to disabled and save the form.
Change the "Label" or "Format" options for the Tags field and save again. The change is not actually saved.
I also updated the description--changed "manage form display" to "manage display" to more accurately reflect what's reported in the gif and the steps to reproduce.
However, a similar issue exists in Manage form display when the field is moved to Disabled and the widget type is not saved.
Steps to reproduce
On /admin/structure/types/manage/article/form-display, move the Tags field to disabled and save the form.
Change the "Widget" options for the Tags field and save again. The change is not actually saved.
Comment #10
capysara CreditAttribution: capysara commentedComment #11
swentel CreditAttribution: swentel at eps & kaas for MuseScore commentedSo one option is to use the 'visually-hidden' class which really is the easiest one, but maybe not the prettiest :)
I've played with #access, but that's not an option since the javascript needs the format select element to be there. Unless we start changing that of course.
Needs tests. If we can agree on using the css trick, I can quickly write a test for it.
Comment #12
xjmTraiged with @catch, @cilefen, @alexpott, @Cottser, and @lauriii. Since this bug is about lost user input on an administrative site builder page, it might not seem that big of a deal. However, it is lost user input, and the user does not expect it. The usability bug occurs when configuring a field in the disabled section and then moving it -- your configurations are stripped away.
Sine there is not that much to re-enter and since it impacts major fields, we discussed that it might only be normal, but it is a loss of user input further exposed by the field UI improvements, that could make your site look goofy.
Thanks @capysara for finding this issue and veriying it! Adding issue credit.
Comment #13
xjmHm, I don't think these fields should just be visually hidden. They would still be available to non-visual browsers, making an accessibility bug. They would also be available to anything altering the form. They should not be available at all in the form, because no data is stored for them. The disabled blocks should just be empty rows until they're dragged back to the enabled block list.
Comment #14
sathish.redcrackle CreditAttribution: sathish.redcrackle at Red Crackle commentedThe patch dint worked for me. I checked the issue and found the below code where they are removing the compound if the field is in hidden state and not saving any value.
as @xjm suggested why we need to change the value of the field display setting which is in hidden stage? since it is not viewable to user.
So i am changing the priority to 'Normal'
Comment #25
xjmRestoring priority; this issue was confirmed to be major by the Drupal core committers.
Comment #26
capysara CreditAttribution: capysara commentedWhat if we make the form fields disabled instead of hiding them altogether?
I found that when I hid them, the column widths adjusted to space out evenly, and, in some cases, it was annoying because it was a pretty significant jump. It's really noticeable on the default Basic page when you move the Body field to disabled, but leave Links displayed.
If disabling them isn't the right approach, I'll work on hiding them, but I wanted to check on it.
Here's POC for the disabled fields:
Comment #29
John Pitcairn CreditAttribution: John Pitcairn commentedIt's pretty annoying as a site builder if you want to disable a few fields to test out some layout variation, then you re-enable them only to find you also have to reconfigure them. If you have a lot of formatter 3rd-party add-ons that's very tedious, and you will forget something.
I also have a more advanced use case - allow layout builder content field blocks to use the configured settings as defaults, and optionally hide that whole formatter mess from site editors who are using layout builder. I've just been working on a proof of concept that stalled on this issue.