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 version alpha6, mapping of boolean fields is broken. My existing mappings showed "missing" for every boolean field I wanted to import. Boolean fields aren't showing up in the list of possible targets.
Comment | File | Size | Author |
---|---|---|---|
#19 | feeds-numeric-mapping-list-1815070-19.patch | 2.74 KB | twistor |
#18 | no_more_mapping_for-1815070-18.patch | 1011 bytes | joelpittet |
Comments
Comment #1
heatherwoz CreditAttribution: heatherwoz commentedI just noticed this too. I'm on alpha7.
Comment #2
vollepeer CreditAttribution: vollepeer commentedIs a fix for this issue planned in an upcoming release?
Comment #3
vollepeer CreditAttribution: vollepeer commentedComment #4
Sethie CreditAttribution: Sethie commentedWill this feature be implemented in an upcoming release?
Comment #5
Taxoman CreditAttribution: Taxoman commentedif this is still a problem with the latest alpha8 release, it belongs in the -dev queue.
Comment #6
luisortizramos CreditAttribution: luisortizramos commentedI've the same problem.
I've hacked the module with some watchdogs in the mappers and the function 'number_feeds_processor_targets_alter' is never called (while the text version is called when I go to the feed edit page).
So it doen't allow us to map all the "number" fields. I'm changing the issue name.
Hope it helps and we can have a solution soon.
Comment #7
jsibley CreditAttribution: jsibley commentedThere doesn't seem to be an update on this issue since June.
Is there any progress? Also not seeing boolean fields as targets for mapping.
Comment #8
jsibley CreditAttribution: jsibley commentedI'm not sure of the downside of this work-around, but I created text field versions of my boolean fields and specified values like "yes" and "no" and this seemed to work for importing from my D6 based csv file.
Comment #9
heatherwoz CreditAttribution: heatherwoz commentedThis issue is about boolean fields, so the title shouldn't be changed. luisortizramos, if you're having an issue with number fields, please open a separate issue. Or if it's somehow the same cause affecting both types of fields, rename the issue to reflect that and edit the issue summary.
Comment #10
luisortizramos CreditAttribution: luisortizramos commentedheatherwoz: boolean fields are a type of numeric fields in Drupal. No one of the different types of number fields are mappeable now, so the issue is really about all of them. If we solve the bug, it will be solved in the numeric field mapper (that includes the booleans, don't worry) so it's more informative for the person who takes time to solve the issue to title it like I did.
Comment #11
heatherwoz CreditAttribution: heatherwoz commentedThanks, your new title is much more descriptive than just "number."
Comment #12
twistor CreditAttribution: twistor commentedUmm...
Can one of you guys give me a detailed setup? I cannot reproduce this, and we have numerous tests for the numeric mapper.
Comment #13
heatherwoz CreditAttribution: heatherwoz commentedI tried on a clean install and I do see those field types available as targets. But they don't show up on several sites that I've had running for a while, since the upgrade from alpha6. Seems like several others were in the same boat. I will keep testing and see if I can come up with any pattern/cause.
Comment #14
twistor CreditAttribution: twistor commentedAhh, I got it.
The quick workaround is to enable the number module.
The list_boolean field is covered by the number module in Feeds, but the number module is not required but the list module. We need to do a bit of dependency re-arranging.
Comment #15
Roar-1 CreditAttribution: Roar-1 commentedCan confirm that a JSON field with a 'true' or 'false' value is not being scooped up, but when changed it to 0 or 1 the boolean fields reflected correctly in Drupal.
Comment #16
mikelaroy CreditAttribution: mikelaroy commentedI've been trying to map to a float list and have been unsuccessful, even with the number module enabled (which it seems to be by default).
Comment #17
Johann Wagner CreditAttribution: Johann Wagner commentedThanks Twistor #14, enabling the Number modules allows me to map boolean fields.
Comment #18
joelpittetFor boolean it gets this callback:
number_feeds_set_target
Which checks is_numeric(). But booleans aren't numeric:
http://3v4l.org/I6b2Y
Suggest that they are checked and set accordingly, see patch. Hope this helps.
Comment #19
twistor CreditAttribution: twistor commentedThis is a bit more correct, so much boilerplate :/
Comment #20
joelpittetThat does look much better, couple of questions:
Is there a reason you went with a private function here but for the others are using public function naming conventions?
Can we use the LANGUAGE_NONE constant here too?
$field[LANGUAGE_NONE][]['value'] = (int) (bool) $value;
Comment #22
twistor CreditAttribution: twistor commentedThanks @joelpittet, fixed that.
Thanks to all for reporting and helping debug.