Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#6 | 949236-6_follow_up.patch | 2.17 KB | Ian Ward |
#5 | 949236-5_follow_up.patch | 2.24 KB | Ian Ward |
#4 | 949236-4_follow_up.patch | 2.1 KB | alex_b |
#2 | feeds-mapper-zero-value-949236-2.patch | 730 bytes | Ian Ward |
#1 | feeds-mapper-zero-value-949236-1.patch | 901 bytes | Ian Ward |
Comments
Comment #1
Ian Ward CreditAttribution: Ian Ward commentedI'm not sure this is the best way to handle. If rows are blank, PDO errors are thrown.
Comment #2
Ian Ward CreditAttribution: Ian Ward commentedAttached is a new patch based on our discussion.
Comment #3
alex_b CreditAttribution: alex_b commentedThis is committed, thank you http://drupal.org/cvs?commit=440162
Comment #4
alex_b CreditAttribution: alex_b commentedOk, we just shot ourselves in the foot: removing the empty check allows for mapping e. g. '' to a numeric which leads to PDO exceptions.
Comment #5
Ian Ward CreditAttribution: Ian Ward commentedAttached is a re-roll with the 'list' type added to the numeric array. The 'list' field type accepts only numeric keys.
Comment #6
Ian Ward CreditAttribution: Ian Ward commentedAnother re-roll, which gets rid of notice when $callback is not set
Comment #7
alex_b CreditAttribution: alex_b commentedThanks, Ian.
http://drupal.org/cvs?commit=441514