Posted by kiamlaluno on January 12, 2013 at 9:44am
5 followers
| Project: | Drupal core |
| Version: | 7.x-dev |
| Component: | forms system |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
| Issue tags: | needs backport to D7 |
Issue Summary
API page: http://api.drupal.org/api/drupal/core%21includes%21form.inc/function/the...
The function contains the following code.
<?php
$element = &$variables['element'];
// This is also used in the installer, pre-database setup.
$t = get_t();
?>$t is never used from the theme function.
That code is remains of Drupal 6 code, where the variable was used from the following code.
<?php
if (!empty($element['#id'])) {
$output .= ' <label for="' . $element['#id'] . '">' . $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) . "</label>\n";
}
else {
$output .= ' <label>' . $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) . "</label>\n";
}
?>The code has been changed since Drupal 7, but the variable is still initialized.
Comments
#1
The function that handles the form element label is
theme_form_element_label(), which is correctly usingget_t().#2
#3
Thanks! Committed/pushed to 8.x.
#4
#5
I didn't notice the title was changed.
#6
Good to go.
#7
Committed to 7.x - thanks! http://drupalcode.org/project/drupal.git/commit/9ae47ea
#8
Automatically closed -- issue fixed for 2 weeks with no activity.