This patch adds mapper support for References module's Node_reference fields.
It comes with comprehensive tests and a includes a small fix to feeds_mapper.test
Based on #724536: Mapper for nodereference field in Drupal 6, ported to D7, cleaned up and streamlined to match coding standards. Tried and tested!
Note: the (upstream) name changed from 'nodereference' to 'node_reference' and never forget a registry entry in .info for tests ;)
Please review at least:
- what is needed in TestCase setUp()?
- do we care which widget we test?
- is there a better way to find test nodes by title? Should that helper be inside the class or not?
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | feeds-node_reference-mapper-1271872-1.patch | 10.55 KB | zany |
| feeds-node_reference-mapper-7.x-2.x.patch | 10.8 KB | zany |
Comments
Comment #1
zany commentedis there a better way to find test nodes by title? Should that helper be inside the class or not?There is
drupalGetNodeByTitle(). Updated patch.Comment #2
glyphman commentedThis worked for me. I am just a site builder, but I needed to import a CSV file to make some nodes. I had a node reference field - but already knew the NIDs for the node references I needed so I added them to the CSV. I just needed the Node Reference field to become a visible target.
Not being setup make the simplest patch, I figured out I could make the new file "node_reference.inc" from the patch file, then drop that into the "mappers" folder in the module. This worked great. It exposed several versions of the node reference field in my content type. I chose "[my field name] (by nid)" - perfect.
Solved my problem of importing 750 records.
Thanks
Comment #3
marcoscanosubscribe
Comment #4
13rac1 commentedDave won't commit module integrations into Feeds. Node reference Feeds integration needs to be added to the References module. Integration work started 12/4/2010 in #988856: Feeds mapper for node_reference and user_reference fields. This issue is duplicate of that issue. Please merge your code(if needed) into the patch located in that issue. Thanks!
Comment #5
zatarain21 commentedSuscribing and testing, thanks