The state toggles for the image instance settings seem to be incorrect (in \Drupal\image\Plugin\Field\FieldType\ImageItem::fieldSettingsForm()).
To reproduce:
- Install site instance and enable "node", "field_ui" and "image"
- Create a new node content type and add a field of type "image" (e.g., field_image) to it.
On the instance settings form for field_image there are options for "Enable Alt field" and "Enable Title field" and below each are the "Alt field required" and "Title field required" options. The second set of "required" options should only appear when their respective "Enable" option is checked, but instead they are always visible.
Solution:
It looks like the '#states' values for the alt/title "required" checkboxes just contain the wrong 'visible' setting. In the case of the form element "alt_field_required" :input[name="instance[settings][alt_field]"]
is tested for TRUE, but I believe :input[name="field[settings][alt_field]"]
should instead be tested.
Comment | File | Size | Author |
---|---|---|---|
#1 | image_state_toggles_for_alt_title_enabled_required-2350723-1.patch | 1.04 KB | rjacobs |
Comments
Comment #1
rjacobs CreditAttribution: rjacobs commentedHere's a patch.
Comment #2
jhedstromGreat catch! Manually tested and this indeed fixes the regression.
Comment #3
alexpottI don't think this is a minor bug. This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed b71d7e6 and pushed to 8.0.x. Thanks!