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

Rework field form API elements so that #title and #description are both availalbe in #pre_render and #after_build functions

$
0
0

Here's the use case: I want to take the #description for a body field and move it into the #title wrapped in a <small> tag.

It's possible to target a specific element and tack on a pre_render or after_build function, but in no cases are the #title and the #description both present and changable.

When I add a pre_render or after_build function to the element itself the #description is present the #title is not changeable, and continues to print out as described by the field UI. For example, when adding a pre_render or after_build function to the element, as so: $form['field_body'][$lang]['#pre_render'][] = 'foo_bar_pre_render';

When I add a pre_render or fter_build function to a value of the element, the #title is changable, but the #description is not present. For example $form['field_body'][$lang][0]['#pre_render'][] = 'foo_bar_pre_render';

#title and #description are supposed to be describing the same element, so they should both be available when working with one.


Viewing all articles
Browse latest Browse all 291170

Trending Articles



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