Problem/Motivation
Following #description_display work defined for elements in issue : #314385: Make position of #description configurable via the API and what has been done more specifically for fieldsets here #2396145: Option #description_display for form element fieldset is not changing anything, this issue defines the same work to be done for details type element. Two issue found :
- The description id is wrong, currently details-description instead of $field_id . '--description as other elements.
- The description_display position is not taken into consideration.
Proposed resolution
Change template_preprocess_details() in form.inc to include accounting of #description_display element key. Also update the details.html.twig templates to use description_display setting.
NOTE: contrarily to fieldset, the description for details is before by default.
Remaining tasks
- Create a WebBaseTest test to check the rendering of the description position in details.- Create a patch to solve the two points of this issue.
- Review patch and fix.
User interface changes
Description of details elements will now be positionned before or after details content depending of description_display.
API changes
None: #description_display should already be part of formAPI regarding #314385: Make position of #description configurable via the API.
RC phase evaluation
Issue category | Bug since this is a lack of functionality regarding a commonly accepted feature of the form API. |
---|---|
Issue priority | Normal because this only affects details element rendering and does not introduce changing in the default values or current functionality. |
Allowed in RC | Because it fixes an accessibility bug. |
Needed in RC | It only changes markup generation and is not disruptive. The main goal of this issue is usability and conformity with formAPI. |
Disruption: Fixes a bug, blocks a contributed project, or should be backported to Drupal 7 | Not disruptive. Fixes an accessibility bug. |