Closed (fixed)
Project:
Migrate
Version:
7.x-2.x-dev
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
15 Jun 2012 at 10:43 UTC
Updated:
16 Jul 2013 at 19:31 UTC
Jump to comment: Most recent file
It would be useful to add an option to mappings to taxonomy term reference fields (and perhaps entity reference fields too) to allow case-insensitive matching of incoming data.
In other words, if the CSV file contains 'FOO', and there's a term 'Foo', allow that to be matched up.
I can see where to change MigrateTaxonomyTermReferenceFieldHandler to make this possible, but I don't know enough about Migrate internals to see how to make that something that can be set as an option at the $this->addFieldMapping() stage.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 1637292.migrate.taxonomy-term-ref-ignore-case.patch | 1.35 KB | joachim |
Comments
Comment #1
mikeryanYou would add your new option to MigrateTaxonomyTermReferenceFieldHandler::fields(), like source_type and create_term. Then, in prepare(), reference it as $arguments['case_insensitive_match'] (or whatever you choose to call it.
Comment #2
joachim commentedThanks for the pointers :)
Here's a patch.
This'll need docs adding to http://drupal.org/node/1224042 as well; I can take care of that.
Comment #3
mikeryanNo patch was attached.
Comment #4
joachim commentedOops. Here it is.
Comment #5
mikeryanCommitted, thanks!
Comment #6
joachim commentedThanks!
Converting this to a docs issue & assigning to me -- I'll add something about this to the docs page for this field mapper when the next release is out :)
Comment #7
joachim commentedOops. Just spotted that the option should be compared to TRUE, not 'tid'!
Comment #8
mikeryanOK, fixed the comparison.
Comment #9
dsim commented#4: 1637292.migrate.taxonomy-term-ref-ignore-case.patch queued for re-testing.
Comment #11
mikeryan@silambarasan - I don't know what you're trying to do here, the patch has already been committed (and thus can no longer be applied). The issue remains active because joachim was going to update the docs.
Comment #12
dsim commentedHi mikeryan,
I was confused with some other issue and did this. Sorry for this unnecessary action i did.
Thanks
Comment #13
mikeryanignore_case is documented at https://drupal.org/node/1224042.