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.
I have a list_boolean field whose CSV column is empty. This produces a bunch of errors because the migration attempts to insert '' into the field whose DB column expects an integer.
It would be handy if the field handler did the conversion.
(Use case: it prevents a clean round trip for this: http://drupal.org/project/migrate_parcel)
Comments
Comment #1
LeandroPerini CreditAttribution: LeandroPerini commentedI found a way to import, you must set the "on" and "off" values.
I went to my field in my content type and set the "on" value to 1 and the "off" value to 0.
In the migration mapping I made a callback function for this field and convert my true value to 1 and the false value to 0, you could do this instead creating a new feature.
This way worked perfectly here.
I don't know if it is a really necessary feature.
Comment #2
mikeryanThere is no patch here.
Comment #3
brad.flewelling CreditAttribution: brad.flewelling as a volunteer and commentedHey i know this was awhile ago but do you have code examples on those callbacks?
I'm adding this $this->addFieldMapping('apachesolr_exclude_node_enabled', 'apachesolr_exclude_node_enabled'); , but since its a boolean im have trouble migrating it.
Comment #4
brad.flewelling CreditAttribution: brad.flewelling commentedDo you have any code examples of those call backs im trying to do $this->addFieldMapping('apachesolr_exclude_node_enabled', 'apachesolr_exclude_node_enabled');, but since they are booleans they are not migrating.