Download & Extend

form field automatic #title

Project:Drupal core
Version:x.y.z
Component:base system
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (won't fix)

Issue Summary

This patch automatically sets the #title of a field if it has been omitted by the programmer. It uses the field's name with underscores replaced by spaces and the first letter capitalized.

AttachmentSizeStatusTest resultOperations
form.inc.autotitle.patch664 bytesIgnored: Check issue status.NoneNone

Comments

#1

Status:needs review» closed (won't fix)

-1, because fields without titles exist and are explicitly catered to (see theme_form_element).

Regardless, it's not a good idea. The titles would not be localized, and would not be user-friendly. Variable names and UI labels are two completely different things.

Finally, ucfirst() is not unicode safe. Use the unicode.inc version.