Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When importing content into a node reference field that is shared the preview import throws the following error:
Fieldname: found no valid post with that title.
I've tried with using either the node title as the reference (the array shows the correct node id) and with using the node id and the error is the same. Here are the relevant parts of of the array that is shown:
[cck:field_drupal:value] =>
[cck:field_company:nid] => Array
(
[0] => 370
)
...
[field_drupal] => Array
(
)
[field_company] => Array
(
[0] => Array
(
[nid] => Array
(
[nid] => 370
)
)
)
The seems related or similar to comment #7 on #236722: Not able to import to CCK "node reference" fields
http://drupal.org/node/236722#comment-1053304
I haven't dug into it deeper yet.
Comment | File | Size | Author |
---|---|---|---|
#22 | 403140-node_import-nodereference.inc_.patch | 1015 bytes | dandaman |
#9 | nodereference.inc_.patch | 480 bytes | Bodo Maass |
Comments
Comment #1
ChrisBryant CreditAttribution: ChrisBryant commentedUpon further debugging it's not a problem with the shared node reference field. It's a problem with having node reference set to autocomplete. When changing the field to a select list the import works perfectly. It seems that if autocomplete fields are being used it shouldn't automatically convert to the nid before the import.
Comment #2
molly_n CreditAttribution: molly_n commentedJust changing the title of the issue...
Comment #3
erikwebb CreditAttribution: erikwebb commentedThankfully I found this post. I've noticed the same issue.
Comment #4
okday CreditAttribution: okday commentedI have the same issue.
subscribing
Comment #5
danieldd CreditAttribution: danieldd commentedI also have the same issue using the autocomplete box for node reference.
When I enter a correct node title name I get the error message: "found no valid post with that title" even if the title is correct. However, the error message shows that the correct nid has in fact been looked up.
When I enter the node number (eg 66786) I get the same message "found no valid post with that title." although the code shows that the nid has been correctly identified.
If I enter "nid:66783" I get the message: "Input error: nid:66783 is not allowed for school (not a node reference).school field is required." [school is the name of my node ref field]
I haven't been able to try the select box workaround for this issue. The table I am referencing has 70,000 nodes and to use select box for node reference in CCK seems to crash drupal - even before I move on to node import (if anyone has a solution to this separate issue please let me know!).
In addition, my title field is not unique so will not work to reference title in this field. What I need is a way of importing a node reference to the nid (or to one of the unique CCK fields in my table if that is possible).
Does anyone have a solution? It feels like this functionality is very nearly working and it shouldn't take much to get it to work.
Aside from this node reference issue (and date) my experience is that node import works fantastically well. However, node reference is critically important.
Comment #6
gavranha CreditAttribution: gavranha commentedsame for me. Works with SELECT LIST; does NOT work with AUTOCOMPLETE. (Thanks Chris. I was lost when I found your comment.)
Comment #7
David Lesieur CreditAttribution: David Lesieur commentedMarked #444884: Integration with nodereference fields only works if nodereference field set to "select" widget as duplicate.
Comment #8
Aren Cambre CreditAttribution: Aren Cambre commentedsubscribe
Comment #9
Bodo Maass CreditAttribution: Bodo Maass commentedI have found the cause of this problem and can offer a partial solution.
The cause is that the validation function nodereference_autocomplete_validate in nodereference.module expects data in a different format than what is supplied by nodereference.inc of node_import. This function expects data in one of three forms:
1. "node title"
2. "node title [nid:node id]"
3. "[nid:node id]"
I was able to make it work for importing noderefs by node id. I have not tested it with importing noderefs by title, although that might work also. In the file node_import/supported/cck/nodereference.inc, the line
$values[$fieldname][$i]['nid'] = array('nid' => $values[$fieldname][$i]['nid']);
needs to be changed into$values[$fieldname][$i]['nid'] = array('nid' => '[nid:' . $value['nid'] . ']');
Comment #10
Bodo Maass CreditAttribution: Bodo Maass commentedComment #11
Bodo Maass CreditAttribution: Bodo Maass commentedComment #12
HunterElliott CreditAttribution: HunterElliott commentedin re #9. I just tried importing via the option2 method, "node title [nid:node id]" and got the errors people mentioned above. Even changing the autocomplete to a select list, at least for me, and using the standard "node title" value for the import only gave me valid imports 9% to 10% of the time.
Comment #13
Bodo Maass CreditAttribution: Bodo Maass commented@HunterElliott:
The options listed are the internal format that the validation function expects, NOT what you need in your csv file to be imported.
To use the patch from #9, you need to apply the patch, and then use node titles or node ids in your csv.
Comment #14
Cyberwolf CreditAttribution: Cyberwolf commentedSubscribing
Comment #15
scotthoff CreditAttribution: scotthoff commentedI get the following error message when i try to do my node import.
I am trying to import into a field that has 2 node references. The node references are passed. It says that they cannot find posts with that title. However, I the posts do have that title. I am not sure where to start.
Record 1:
Original Word:found no valid post with that title.
Translated Word: found no valid post with that title.
Comment #16
CreatixEA CreditAttribution: CreatixEA commentedHi,
I had the same issue. If I change the field's widget to "list of selection" that works correctly (if set as "autocomplete text input" that failes ...)
Comment #17
scotthoff CreditAttribution: scotthoff commentedIt is correct This does fix it. However, now if I dont' do it via import the process is near unusable.
Comment #18
Anonymous (not verified) CreditAttribution: Anonymous commentedSubscribe
Comment #19
scotthoff CreditAttribution: scotthoff commentedIt seems like the only option is to move back and forth between the settings depending on the task?
Comment #20
drupalerocant CreditAttribution: drupalerocant commentedHello, I had the ame problem and was fixed with changing to select list.
thank you very much
Comment #22
dandaman CreditAttribution: dandaman commentedHere's a patch that might help this issue: it should now work with both Select lists and the Autocomplete version.
Comment #23
Vacilando CreditAttribution: Vacilando commentedSame problem... getting "Input error: John Doe is not allowed for Pupil (not a node reference)" even though there is an entry in the import file for "John Doe".
Unfortunately, dandaman's patch has not solved the problem - in my case at least.
Comment #24
dandaman CreditAttribution: dandaman commentedSorry, mine helps if you're putting NIDs in the nodereference field for the import.... vacilando, obviously you're putting in the title in the field... is it set up as a select, checkbox, or autocomplete?
Comment #25
Vacilando CreditAttribution: Vacilando commenteddandaman, I do use it for titles, yes. I had set it up as autocomplete, then changed to select, with the same negative result.
Comment #26
jcodina CreditAttribution: jcodina commentedSubscribe
Comment #27
jcodina CreditAttribution: jcodina commentedif there various node reference fields in a content type there is no way to import content. If there are only one is possible
Comment #28
dandaman CreditAttribution: dandaman commentedfrierab, I got it to work with a bunch of NIDs separated by pipes for multiple references. I most likely was using the patch that I provided above, but I did get it to work somehow.
Comment #29
Exploratus CreditAttribution: Exploratus commentedsubscribe
Comment #30
dustobub CreditAttribution: dustobub commentedHas anyone found a solution to using Node Titles + Autocomplete Widget? I need to use Autocomplete as I am using the Node Relationships plugin for the additional search/create/edit functionality.
@frierab, have you found a solution to the multiple node references per content type issue?
Thanks,
Dustin
Comment #31
verres CreditAttribution: verres commentedi'm having the same difficulty - import hangs because node-import doesn't like the value in the node-reference field. I've tried switching the node-reference field widget to select list (from autocomplete) and I've tried formatting the import file to be, (1) the title value, (2) the node id value and (3) '[nid:node id]' ... in no cases does the module recognize the value of this field....
Comment #32
travVT CreditAttribution: travVT commentedHey Everyone,
I'm having the same issue as well, but I was able to work around this by doing the following:
1.) Switch the type of the CCK field to "Select List"
2.) Use Node Import to load data
3.) Switch the type of the CCK field back to "Auto Complete"
I haven't discovered any issues with this method yet, but I'll keep you posted!
Thanks,
Trav
Comment #33
DarrellDuane CreditAttribution: DarrellDuane commented#22 worked for me when I had node titles in my CSV file. This was patched against the -dev version as of today.
Comment #34
HansKuiters CreditAttribution: HansKuiters commented#22 worked for me with nid's in my csv (just a number, no 'nid:' prefix). Thanks.
Comment #35
alanpeart CreditAttribution: alanpeart commentedLifesaver! Thank you....#22 was the charm.
Comment #36
Jorrit CreditAttribution: Jorrit commented#22 worked for me too.
Comment #37
Josh Benner CreditAttribution: Josh Benner commented#22 confirmed further. Seems ready for commit?
Comment #38
Mac_Weber CreditAttribution: Mac_Weber commentedTry changing the nid value to "[nid:xxxx]"
It may be related to http://drupal.org/node/1353662
I posted a tutorial of how I solved it for the Services 3 module with NO lines of code:
http://drupal.org/node/1354202
Comment #39
deranga CreditAttribution: deranga commentedThanks Bodo, this helped me to get it working as below
For anyone else I used the following with an auto-complete node reference field in Drupal 6:
Comment #40
hovel CreditAttribution: hovel commentedYou can find my solution here: Cannot import nodereference autocomplete nor nodereference buttons fields
It solves problems I had importing nodereference autocompletion and nodereference buttons fields.