The node import module allows users to enter values for CCK fields for import. If your text field is an autocomplete widget for an allowed values list this fails because the user enters values while _autocomplete_widgets_get_options_allowvals looks for ids.

For example:

Say you allowed values list is this:

id1|val1
id2|val2
id3|val3

In the users CSV file they will enter val1 into a column and expect it to import. This does not work because of the follow lines:

else if ($match == 'equals') {
  if ($value == $string) {
    $options[$key] = $value;
    $count++;
  }
}

In the case of a node import $value is val1 and $string is id1. Because they're never equal, val1 never gets added to the $options array and the user receives the "found no valid option." error.

Adding a check for if $key == $string will cover this case.

Patch on the way...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

infiniteluke’s picture

Status: Active » Needs review
FileSize
481 bytes

Adds a check for if $key == $string for node import purposes.