Active
Project:
Node import
Version:
5.x-1.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Aug 2008 at 13:48 UTC
Updated:
4 Dec 2009 at 22:08 UTC
Jump to comment: Most recent file
Because of the use of "SOUNDS LIKE" rows with empty values for a node reference field can be matched against nodes with all numeric titles.
Tiny patch attached.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | content.inc_.patch | 380 bytes | vectoroc |
| content.inc_.patch | 477 bytes | a_c_m |
Comments
Comment #1
a_c_m commentedComment #2
Robrecht Jacques commentedThis should be fixed. Can you check node_import-5.x-1.7 or later? If it still does not work, reopen the issue with an example CSV file.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #4
developone commentedThis seems to still be an issue,
I have upgraded to 5.x-1.9 and have 1 node reference field which does not get import,
I have added a print_r where the nodes to be imported get previewed and this is what I see for the
node reference field
[field_area_0] => Array
(
[0] => Array
(
[nid] =>
[error_field] => field_area_0][nids
[view] =>
)
[nid] => �0
)
After tracing through the code quit a bit It seems that the field data is getting changed once
node_invoke_nodeapi is being called when creating the preview of nodes to be imported.
Comment #5
Robrecht Jacques commentedreopening it
Comment #6
developone commentednodereference.module
case 'process form values':
if ($field['multiple']) {
// if nothing selected, make it 'none'
if (empty($items['nids'])) {
$items['nids'] = array(0 => '0');
}
// drop the 'none' options if other items were also selected
elseif (count($items['nids']) > 1) {
unset($items['nids'][0]);
}
$items = array_values(content_transpose_array_rows_cols(array('nid' => $items['nids'])));
}
else {
$items[0]['nid'] = $items['nids'];
}
I may be mistaken but it looks to me like the else statement should be
$items[0]['nid'] = $items['nid'];
and not
$items[0]['nid'] = $items['nids'];
if i remove the 's' - the nodereference imports perfectly (NOTE: actually only shows correctly in preview but still fails to be saved)
not sure though if this will have any impact on the normal functioning of nodereferences elsewhere!
Comment #7
developone commentedIn nodereference.module in function nodereference_widget, it seems we need to unset the $items['nid'] value the same way we unset
$items['nids'] - I got the nodereference import to work perfectly by changing:
$items = array_values(content_transpose_array_rows_cols(array('nid' => $items['nids'])));
}
else{
$items[0]['nid'] = $items['nids'];
}
// Remove the widget's data representation so it isn't saved.
To:
$items = array_values(content_transpose_array_rows_cols(array('nid' => $items['nids'])));
}
elseif (!isset($items[0]['nid'])) {
$items[0]['nid'] = $items['nids'];
} else {
unset($items['nid']);
}
// Remove the widget's data representation so it isn't saved.
Comment #8
vectoroc commented#7 - it works for me.
I do not believe that is cck problem
Comment #9
vectoroc commentedI believe that is better solution