2 potential bugs, 1 report. Hope that's OK.
User: 1 (full privileges)
Drupal 6.15
Node Imprt 6.x-1.0-rc4
Node Reference Create (noderefcreate) 6.x-1.0
CCK 6.x-2.6
PHP 5.2.10-2ubuntu6.4
1) Strange behavior with node reference create
Have a Person content type with an "Institutional Affiliation" field that references an Institution content type. I created all of the Institutions before doing the import, the names all match 100%. When this Institutional Affiliation was set to Type: "Autocomplete text field with create" (using Node Reference Create module), Node Import created a new Institution for each person (with names "7" or "8" or "4", strangley enough) instead of referencing the original institutions.
Workaround: Change Node references type to select list before importing. Change back after the import.
2) Problems importing node references with similar names
Have two institutions: University of Michigan and University of Michigan Biological Station. Node references to "University of Michigan" work fine, node references to "University of Michigan Biological Station" fail and produce this error: "Institutional Affiliation: this post can't be referenced."
Workaround: Change the Institution name from "University of Michigan Biological Station" to "UMBS University of Michigan Biological Station" - and reflect this in my csv import - everything works fine.
Thanks for your work on this module.
Kyle
Comment | File | Size | Author |
---|---|---|---|
#10 | noderefcreatesupport.patch | 732 bytes | kbk |
#5 | normal_node_ref.txt | 172.16 KB | kbk |
#5 | create_node_ref.txt | 172.28 KB | kbk |
#5 | noderefcreate.diff | 2.26 KB | kbk |
Comments
Comment #1
deltab CreditAttribution: deltab commented+ Subscribing, I am experiencing this too.
Comment #2
Vacilando CreditAttribution: Vacilando commentedSubscribing.
Comment #3
Isostar CreditAttribution: Isostar commented+1 subscribing
Comment #4
kbk CreditAttribution: kbk commentedI should never have posted two reports in the same issue. I've now moved point 2) to its own report: #993510: Problems importing node references with similar names. Please use this issue for problems related to 1) Compatibility with Node Reference Create.
If someone would like to remove 2) from the original post, please do so. Thanks and sorry.
Comment #5
kbk CreditAttribution: kbk commentedI'm taking the liberty to look into this myself. I'm a total newb at php so we'll see how it goes. First, I am assuming the difference in the node add form for a content type with a normal NodeReference versus a NodeRefCreate field is the foundation of our problem. Here are the differences (from what I can gather):
Node reference with autocomplete:
Node reference create with autocomplete:
NodeRefCreate add something else to the form. I don't understand this at all and I hope it is inconsequential:
See attached for the the node add forms associated with my content type 'Person' with and without NodeRefCreate. The third file is a diff of the first two.
Comment #6
kbk CreditAttribution: kbk commentedLooking at nodereference.inc there is this interesting portion:
dpm($form) shows that NodeRefCreate has the same 'braindead' structure.
Comment #7
kbk CreditAttribution: kbk commentedModifying the above test to:
Improves matters a little. Without the test, Node Import creates a node where the Node Title is the first number of the NID (I'm using NIDs instead of Node Titles) in the imported file. Adding the test still results in a node being created (rather than referenced) but it at least uses the full NID.
Comment #8
kbk CreditAttribution: kbk commentedIn the event that the #process bit from #5 is actually important, it arises in noderefcreate.module:
Comment #9
kbk CreditAttribution: kbk commentedGot it working - I think - and I am a bit frustrated because the solution seemed to rely on a patch that has been pending for 2 years.
Basically you would do as I did in #7 and use a patch from this issue: #403140: Error on autocomplete node reference field: found no valid post with that title.
I used this patch:
http://drupal.org/node/403140#comment-2309632
But this patch looks similar and is more recent:
http://drupal.org/node/403140#comment-2892098
Note: this will allow you to use NodeRefCreate when you are importing the NID, Node Title imports with NodeRefCreate are untested.
Comment #10
kbk CreditAttribution: kbk commentedFor Node Reference Create compatibility apply the attached patch to the dev version of Node Import and then apply the patch found here:
http://drupal.org/node/403140#comment-2892098
NOTE: This is tested when importing NID values, not Node Titles. There are several issues pending re: Node Title imports so it will be difficult to tell where the problem lies.