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.
This is just a copy/paste from: http://drupal.org/node/1246578#comment-6104694 posted by miltonsp
The 'Convert to boolean' plug-in does not work out-of-the-box in Drupal 7.
Here is a small patch to make it work.
Index: .../feeds/feeds_tamper/plugins/convert_boolean.inc
===================================================================
--- ... /feeds/feeds_tamper/plugins/convert_boolean.inc
+++ ... /feeds/feeds_tamper/plugins/convert_boolean.inc
@@ -79,11 +79,11 @@
$match_field = drupal_strtolower($match_field);
}
if ($match_field == $settings['true_value']) {
- $field = TRUE;
+ $field = 1;
return;
}
if ($match_field == $settings['false_value']) {
- $field = FALSE;
+ $field = 0;
return;
}
if ($settings['no_match'] == 'pass') {
Comments
Comment #1
topham CreditAttribution: topham commentedThanks! I spent a significant amount of time trying to get a boolean field working before checking the issues queue.
Comment #2
grahamCI see this patch has already been committed to 7.x-1.x-dev, but it fails to update the "no_match_value" to use 1 and 0 as well...
Comment #3
twistor CreditAttribution: twistor commentedCan you tell me about your setup? I am curious in what configuration 1 works but TRUE does not.
Comment #4
grahamCI've got a Field of type Boolean (Single on/off checkbox). The "On" and "Off" values are left blank, so it uses the defaults which are 1 and 0.
Comment #5
twistor CreditAttribution: twistor commentedThis was fixed in 7.x a long time ago.
6.x http://drupalcode.org/project/feeds_tamper.git/commit/73779cc