Trying to build a custom profile field using list selection and lots of country names, like

Aland Islands
Andorra, Principality of

I found, that the list selection selection options field is split by linefeed, newline, and comma.
My selection list looks like:

Aland Islands
Andorra
Pricipality of

I think, splitting by linefeed/newline is enough, OR spliting by comma, but not both.
At least, the splitting functionality should be mentioned in the field description.

Removing the comma from the split command in profile.module solved my problem, so it reads now:

...
// line 662 - 668
      case 'selection':
        $options = $field->required ? array() : array('--');
        $lines = split("[\n\r]", $field->options);
        foreach ($lines as $line) {
          if ($line = trim($line)) {
            $options[$line] = $line;
          }
        }
...

(At line 555 there is another split function.)

Maybe it's a interesting idea to have the field delimiter configurable.

(A forum entry is found here: http://drupal.org/node/89106)

Comments

edmund.kwok’s picture

Status: Active » Closed (duplicate)

Issue marked duplicate in favor of patch submitted in http://drupal.org/node/90221.