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

LeandroPerini’s picture

Issue summary: View changes
Status: Active » Needs review

I 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.

mikeryan’s picture

Status: Needs review » Active

There is no patch here.

brad.flewelling’s picture

Hey 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.

brad.flewelling’s picture

Do 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.