Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In registration_form()
in registration.forms.inc
:
// Ensure default state is in options or it won't be set.
if (!in_array($default_state->label, $states)) {
$states[$default_state->name] = $default_state->label;
}
First, that's a very strange way to see if an #option is set, because you're checking the labels, not the keys. Second, $default_state->label
is not the right way to create the missing option's label, because it's different from registration_get_states_options()
.
It should do this:
// Ensure default state is in options or it won't be set.
if (!isset($states[$default_state->name])) {
$states[$default_state->name] = t('@state', array('@state' => entity_label('registration_state', $default_state)));
}
The t('@state')
is very weird IMO, but the entity_label()
is very important, because that's a custom translation moment for other modules.
Patch later.
Comment | File | Size | Author |
---|---|---|---|
#2 | registration-2589941-1.patch | 738 bytes | rudiedirkx |
Comments
Comment #2
rudiedirkx CreditAttribution: rudiedirkx commentedComment #3
Chris Matthews CreditAttribution: Chris Matthews commentedThe patch in #2 is 3 years old, but still applied cleanly to 7.x-1.x-dev and looks like a good fix so changing the status to RTBC.
Comment #6
gcb