So say you have allowed values of:

array(
  1 => 'one',
  2 => 'two',
  3 => 'three',
)

fieldtool_set($fields['field_number'], $node, 'three') won't work as it should.

Comments

Matthew Davidson’s picture

Status: Active » Fixed
StatusFileSize
new8.79 KB

Actually, above that should be fieldtool_import() rather than fieldtool_set().

Accordingly, this patch adjusts fieldtool_field_generic_value_itemize() to translate a value matching an allowed value label to it's corresponding key. Only attempts this on CCK field types, and silently fails, passing on the input value as received. Validation (as always) is left to Node API or Form API.

Matthew Davidson’s picture

Okay, stupid. Created the patch from the wrong version. For the record, here's the patch against HEAD.

Matthew Davidson’s picture

Brain-dead bugfix.

Status: Fixed » Closed (fixed)

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