My CSV import fails to update existing nodes identified by concatenated data I passed into the unique GUID target field. Please point out my mistake or suggestions for making updates work.
I was importing a CSV file to create nodes of an existing content type. I would like to update existing nodes upon import. The titles are not unique, and the Feeds fields 'Title' and 'GUID' are the only two target fields for which I can choose 'Unique.'
To create a unique ID, I had to use Field Tamper to concatenate two fields, 'Column 1' and 'Column 2'. I did that by setting the target of 'Column 2' to GUID, setting GUID to be unique, and setting the tamper to concatenate the two fields. (Concatenating those two fields elsewhere does work just fine.) I had already set the Node Processor settings to 'Update existing nodes.'
The nodes were correctly created by this import, but subsequent imports created duplicates instead of updating the existing nodes.
If it matters, other nodes of the same content type were created through a user interface.
How can I change this importer to update existing nodes, please?
Comments
Comment #1
MichaelGreisman commentedSorry for prodding, but I'm hoping that an edit to my title might result in some more interest in the ticket.
I decided against link-baiting it, e.g. "See 3 ways to import updates; 1 way to fail!"
I doubt this is a failure of the built-in GUID field; this is most likely a step I'm missing in making it work. I've seen some suggestions that other modules are needed (such as Field Validation), but I didn't want to make additions that would seriously effect the rest of the large project in order to solve this one issue.
Comment #2
megachrizI can not reproduce your issue (I tested with the latest dev). Note that only nodes imported with Feeds have a GUID. Manually created nodes do not have them. GUID's are saved in the feeds_item table.
Comment #3
MichaelGreisman commentedIt's not really a reproducible issue. So... I was trying to import some user-friendly text into GUID, which wouldn't have helped me anyway if I were trying to import updates to manually-created nodes.
Is there any other way to import updates to manually-created nodes (as well as Feeds-imported nodes), besides using the Title as the unique identifier? Otherwise I have to do edits to the content type and existing data in order to use the Title for the identifier instead of for the content's actual title (which can't be guaranteed to be unique).
thanks!
Comment #4
megachrizYes, there is another way to update nodes using another unique identifier.
hook_feeds_processor_targets_alter()in a custom module.optional_uniquetoTRUE.unique_callbacks.See (after having applied the patch from #661606) feeds.api.php for further information and examples. Look specific to the examples for
hook_feeds_processor_targets_alter()and formy_module_mapper_unique.I hope this answers your question. If not, feel free reopen.
Comment #6
brandonc503 commented*deleted as i cant remove account