Document that #tree property has no effect on #markup elements

Created on 26 August 2011, over 13 years ago
Updated 26 March 2025, about 2 months ago

If you use code similar to the following one to define the items shown in a form, in a form builder, the rendered form contains just the markup element; the textfield will not be rendered.

  $form['html'] = array(
    '#type' => 'markup',
    '#markup' => '<h2>My Heading</h2>',
    '#tree' => true,
  );

  $form['html']['element'] = array(
    '#type' => 'textfield',
    '#title' => 'Foo',
  );

The reference page for the "markup" element reports the "#tree" property as supported by the "#markup" element. The expected result would be that the child items of that element are rendered too.

📌 Task
Status

Closed: won't fix

Component

API documentation files

Created by

🇮🇹Italy apaderno Brescia, 🇮🇹

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024