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?

Comments

zany’s picture

StatusFileSize
new10.55 KB

is there a better way to find test nodes by title? Should that helper be inside the class or not?
There is drupalGetNodeByTitle(). Updated patch.

glyphman’s picture

This 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

marcoscano’s picture

subscribe

13rac1’s picture

Project: Feeds » References
Component: Code » Code: node_reference
Status: Needs review » Closed (duplicate)

Dave 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!

zatarain21’s picture

Suscribing and testing, thanks