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.

CommentFileSizeAuthor
#2 registration-2589941-1.patch738 bytesrudiedirkx
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rudiedirkx created an issue. See original summary.

rudiedirkx’s picture

Status: Active » Needs review
FileSize
738 bytes
Chris Matthews’s picture

Status: Needs review » Reviewed & tested by the community

The 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.

  • gcb committed 457b2b7 on 7.x-2.x
    git commit -m 'Issue #2589941 by rudiedirkx, Chris Matthews: Default...

  • gcb committed eb3c154 on 7.x-1.x authored by rudiedirkx
    Issue #2589941 by rudiedirkx, Chris Matthews: Default state check...
gcb’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.