Element's description not being displayed if it is a formatted text and represented as a render element.

includes/webform.theme.inc

$variables['description']['content'] = [
        '#type' => 'container',
        '#attributes' => new Attribute($description_attributes),
      ] + $description;

So a container element type is used. And description array is being concatenated with it instead of being inserted as a child. It works when description is a ['#markup' => $element['#description'] array but not when it's a separate render element like this:

Array
(
    [#type] => processed_text
    [#text] => Voornaam
    [#format] => full_html
)

Description array should be inserted as a child of the container array.

Comments

solariel created an issue. See original summary.

solariel’s picture

solariel’s picture

Status: Active » Needs review
jrockowitz’s picture

StatusFileSize
new970 bytes

@solariel Thanks for the patch.

The webform element description is pretty a complex render array so I think rendering the description makes things a little simpler and keeps the current output consistent.

Please review the attached patch.

  • jrockowitz committed b5fc2f1 on 8.x-5.x
    Issue #2995814 by solariel, jrockowitz: Formatted descriptions are not...
jrockowitz’s picture

Status: Needs review » Fixed

I committed the patch. Please download the latest dev release to review.

solariel’s picture

@jrockowitz
It works. Thank you for quick response!

  • jrockowitz committed 7771fa8 on 8.x-5.x
    Issue #2995814 by solariel, jrockowitz: Formatted descriptions are not...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.