In field.inc mapper, in field_feeds_set_target it starts out like:

if (empty($value)) {
  return;

However, if $value is an integer `0` then empty(0) evaluates to empty and therefore returns instead of mapping the `0` value. Patch to follow.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ian Ward’s picture

I'm not sure this is the best way to handle. If rows are blank, PDO errors are thrown.

Ian Ward’s picture

Attached is a new patch based on our discussion.

alex_b’s picture

Title: typing issue when mapping values of "0" » Allow mapping empty values to fields
Status: Needs review » Fixed

This is committed, thank you http://drupal.org/cvs?commit=440162

alex_b’s picture

Status: Fixed » Needs review
FileSize
2.1 KB

Ok, we just shot ourselves in the foot: removing the empty check allows for mapping e. g. '' to a numeric which leads to PDO exceptions.

Ian Ward’s picture

FileSize
2.24 KB

Attached is a re-roll with the 'list' type added to the numeric array. The 'list' field type accepts only numeric keys.

Ian Ward’s picture

FileSize
2.17 KB

Another re-roll, which gets rid of notice when $callback is not set

alex_b’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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