Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
API page: http://api.drupal.org/api/drupal/core%21includes%21form.inc/function/the...
The function contains the following code.
$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.
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.
Comment | File | Size | Author |
---|---|---|---|
#4 | fix-variable-1886812-4.patch | 496 bytes | apaderno |
#1 | fix-variable-1886812-1.patch | 524 bytes | apaderno |
Comments
Comment #1
apadernoThe function that handles the form element label is
theme_form_element_label()
, which is correctly usingget_t()
.Comment #2
swentel CreditAttribution: swentel commentedComment #3
catchThanks! Committed/pushed to 8.x.
Comment #4
apadernoComment #5
apadernoI didn't notice the title was changed.
Comment #6
swentel CreditAttribution: swentel commentedGood to go.
Comment #7
David_Rothstein CreditAttribution: David_Rothstein commentedCommitted to 7.x - thanks! http://drupalcode.org/project/drupal.git/commit/9ae47ea