Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 298718

Make the description items of managed_file widgets distinguishable

$
0
0

Problem/Motivation

In Claro, we wrap even single-cardinality file widgets in a HTML5 details. We need to display its description similar to how multiple value widget does, so render the description (that's set up in the field config) in the details, separated from the other descriptions (that are computed from the file and image upload validators and based on the field cardinality).

Actually, the description of the managed file widgets is rendered (by field_widget_multiple() and even in FileWidget), and all of these descriptions are merged into a single MarkupInterface, and the field-config description key $element['#description'] (this key contains the field config description) is replaced with the rendered and merged description.

Right now, the only way to get back the potential field config description is to render the file_upload_help with an empty #description key, and compare its string value of the original, rendered description.

Proposed resolution

Keep the original field config description somewhere in the renderable array.
The best would be not rendering the description at all and return a renderable array instead, but I guess this cannot happen because BC reasons.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 298718

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>