Needs work
Project:
UUID Extras
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Oct 2012 at 06:00 UTC
Updated:
24 Jul 2015 at 13:56 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
milesw commentedHere's a mapper that's working well for me so far. I'm using it to import taxonomy terms from one site to another, preserving their UUIDs. It should also work for nodes and other entities.
Comment #2
capnut commentedThe above mapper hasn't worked for me,
when I was trying to import Commerce Product entities - UUID field in database stayed empty for them.
In the same time - I can succesfully map & populate UUID data from source CSV to target GUID field.
Update: above report is incorrect.
Having a UUID mapper in Feeds would be useful indeed though.
Comment #3
milesw commentedHmm, if your UUIDs are empty in the database you might have other problems. Even if the Feeds mapper isn't mapping values, the UUID module should always be generating UUIDs on hook_entity_presave().
Comment #4
capnut commentedThat is probably because Commerce Products entities do not have native UUID support and I have enabled it for them through Entity UUID module. UUIDs are generated when I create products manually, but not when I import them through Feeds for some reason.
Comment #5
milesw commentedStrange, I'm not seeing how that might happen. Entity UUID just creates the tables and enables UUID for an entity type. It's still the UUID module that generates the UUIDs. You could try debugging in uuid_entity_presave().
Comment #6
capnut commentedIndeed, it looks like the issue is not with the field mapper, sorry for misinformation.
My report above is incorrect.
As for the UUIDs for Commerce Product — they are not getting created automatically at all, UUID field gets populated only upon module install & when 'Create Missing UUIDs' command is executed from UUID configuraiton menu. But that is another issue.
Comment #7
guillaumev commentedHi,
I can confirm that this patch is useful (at least for me) and working.
Would love to see it committed :-)
Comment #8
btopro commentedPatch looks good, you can compair it's UUID import to that found in http://drupal.org/project/feeds_node_helper as it's had UUID support for some time (been running it in production for months).
Comment #9
msmithcti commentedThe patch in #1 works great, but a UUID doesn't make much sense without it being a unique key in the feed. The following patch provides this functionality.
This patch is dependent on #1286912-7: Existing Item Node Mapping should be extensible as an additional hook is required in the feeds module.
Comment #10
cthiebault commentedYour patch is not working with Drush:
Here is the same patch that works.
The second file is the good one... Sorry for that :(
Comment #11
rcodinaHere is an alternative:
https://www.drupal.org/project/feeds_node_helper
Comment #12
gabriel.achille commented@rcodina: I think the module Feeds Node Helper does something different because for me it doesn't work the way i expected: the imported node get created with a different UUID than in the source site.
But the patch #10 is ok for me.
Comment #13
btopro commentedthat's news to me cause it's one thing I hate about the module is that it KEEPS the uuid for imports (maintainer).
Regardless I agree there should be patched support directly in UUID and not an obscure feeds submodule
Comment #14
miroslavbanov commentedPatch #10 works for me too. Tested setting uuid when importing File entities.
Comment #15
nicxvan commentedWorks for me too! Can we get this committed?
Comment #16
nicxvan commentedUse as unique doesn't seem to work correctly.
Comment #17
miroslavbanov commented@nicxvan
You must have other mappers that are also used as unique. It will work once you make sure you only use the uuid as unique and nothing else.
Comment #18
nicxvan commented@MiroslavBanov I only had UUID as unique. In fact the workaround was to assign uuid to guid as well and make that unique.
Comment #19
miroslavbanov commented#nicxvan
Coincidentally, I now see that this is exactly how my feeds importers were set as well. So I guess there may be a problem with "Use as unique". Though I'm not sure what causes the problem.
Comment #20
gabriel.achille commentedActually, i have the same behavior too. I had to do this double assignment in the feeds settings in order to have the original UUID store in the UUID field AND avoid duplication of the node with the same UUID !
Comment #21
skwashd commentedThe patch looks good, but I won't be including it in the UUID project. This project focuses on supporting core entities and generic UUID utility functions. I would suggest that this work be combined with #2348035: Add Feeds term matching. to create a feeds_uuid (or uuid_feeds) module that lives independently in contrib.
Comment #22
yanniboi commentedHey @skwashd,
I am sympathetic to your decision to not support non-core integrations in your module. I am going to post an updated version of the feeds integration patch, which is inline with the latest version of feeds (7.x-2.0-beta1) here as I haven't got time to publish a module now, and this seems the best place for now.
If I were to write a uuid_feeds module, would you be able to add it to uuid alongside uuid_services/etc? I'm not sure having a standalone module with less than 100 lines of code is the most elegant solution to this integration problem...?
Comment #23
yanniboi commentedApologies, dudd patch....
Comment #24
skwashd commentedThis belongs in the newly created UUID Extras project. I don't know enough about feeds to evaluate the suitability of this patch, but the formatting and docs look fine to me.
Comment #25
yanniboi commentedOK, I will adapt the code for uuid_extras and test.