Closed (won't fix)
Project:
Profile 2
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Jul 2011 at 11:54 UTC
Updated:
16 May 2020 at 21:13 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
wusel commentedComment #2
wusel commentedI want to explain my wish:
On the page "Mapping for User processor" I can only add Targets from the normal core-Profile-fields.
But I want to add fields from the "Profile2"-fields.
Then I would be able to import new users with normal fields AND "Profile2"-fields in one step out of one CSV-file.
Where can I connect the "Profile2"-fields to the CSV-Importer?
Can I get the code I have to add in what file of a new module?
Thanks in advance
Comment #3
bjlewis2 commentedThis would be fantastic! I will soon be importing hundreds of users to a site, and would REALLY like to be able to import Profile2 info at the same time!
Comment #4
CraigSander commentedIs there a way to do this without directly accessing the SQL database?
Comment #5
wusel commented@CraigSander:
I want to import the CSV-file directly from the user interface.
Comment #6
wusel commentedI change the Component to 'Code' and updated the Version to '7.x-2.x-dev (2011-Aug-14)'.
Comment #7
webadpro commentedHas this been fixed yet or not?
Comment #8
wusel commentedDespite my update to the module-version 7.x-2.x-dev on my site, I can not find a "Profile2"-field on the page "Mapping for User processor".
Comment #9
ellocin commentedHello,
I've followed this thread for one month and perhaps a piece of my work could help someone. I've written a Profile2Processor to import fields. (see the code attached). I'm new in drupal/php world, so all advices are welcomed!
regards,
Comment #10
wusel commentedThank you very much.
I use Drupal 7.8 (all drupal-module are up-to-date).
After I enabled your module, I have build a new feeds-importer, there I selected the 'Feeds Profile2 Processor'.
Then I have selected 'Update existing profiles (slower than replacing them)' (your comment in line 9 of feeds_profile2_processor.inc).
When I click on 'Mapping', I get a white screen only with the text 'Fatal error: Call to undefined function dsm() in C:\xampplite\htdocs\abt\sites\all\modules\feeds_profile2_processor\feeds_profile2_processor.inc on line 221'.
Something is wrong with 'dsm()'. My drupal does not know this function.
So I add an '//' in the beginning of line 221 of feeds_profile2_processor.inc and clear the drupal-cache.
Now I can click on 'Mapping' to choose the fields.
I will test your 'Feeds Profile2 Processor' this weekend and update this comment or add a new one as soon as possible.
Comment #11
ellocin commentedsorry for this,
I forgot to remove the dsm (from devel module) function calls...
regards,
Comment #12
johnbarclay commentedHere is another approach: Use the generic entity processor #1033202: [Meta] Generic entity processor patch, since profile2 users are entities as suggested in #1135450: Importing users to Profile2.
I have not tried this, but it seems like a more sustainable path since the profile 2 patch doesn't belong in the feeds project and the profile2 module already marked such a feed mapper.
Comment #13
wusel commented@ellocin:
I had to add another '//' in the beginning of line 77 of feeds_profile2_processor.inc.
I connect the 'Owner name' with the same field of the user in my CSV-file, then your module works very fine.
Thank you very much for this great module.
Do you want to publish this as well? Or the maintainers?
Comment #14
wusel commented@maintainers:
My CSV-file cannot contain the UID of the user, since the UID arises from Drupal when creating the user by the (first) Feeds User-import. So it is not possible to connect the Profile2-fields to the account during the second Feeds Profile2-import by using 'Entity processor Profile type' as definend by #1033202: [Meta] Generic entity processor-#54.
Please complete this module with the code in #9 ('Feeds Profile2 Processor').
Many thanks in advance.
Comment #15
wusel commentedComment #16
ellocin commented@wusel
no problem to publish this module but I don't know how to do that (from dashboard??)....I'm going to search into drupal.org.
regards,
Comment #17
awasson commentedSubscribing... This seems like a pretty obvious must have feature for Profile2. I'm giving the module that ellocin provided on #9 and it seems like it should work. I'll have a look at the patch as well.
Comment #18
drnikki commentedThe code in #9, with a few modifications, works fine for initial user & profile2 creation, but fails on updating existing users, even with unique target provided. I'm working on a solution for this, but wondering (hoping!) that someone beat me to it.
Comment #19
ambientdrup commentedThe code in #9 does not seem to be working for me. I've created 2 fields using Profile2. Then I've installed this feeds_profile2 processor module and cloned my User importer. When I configure the importer to use the feeds_profile2 processor it's not letting me choose the 2 fields I've added in my mapping. I also get the following error:
Notice: Trying to get property of non-object in FeedsProfileProcessor->getMappingTargets() (line 191 of /Applications/MAMP/htdocs/www/sites/all/modules/feeds_profile2_processor/feeds_profile2_processor.inc).
Suggestions?
-Trevor
Comment #20
ambientdrup commentedYou can ignore my request in #19. I realize it's working with the dev version of the Feeds module. I installed the Dev version and now I see the mapping ... and the error disappeared too.
-Trevor
Comment #21
ambientdrup commentedOk so I'm running into some additional issues with the module in #9:
1) I can import users with the generic User Import importer via Feeds module. I set the id = GUID as the unique key.
2) I then verify that I have created 9 users on the site via the importer
3) I create 2 profile fields using Profile2 module and verify that these show up as fields on the user accounts
4) I run an import using this custom feedsprofileprocessor module. I map the first and last name fields that I've set up in my profile2 to those 2 fields in my imported CSV file
5) Running the import says that the profiles have been imported
6) But when I view the user account the first and last name fields are still empty. So the data is not getting mapped to the correct accounts.
Also I did set up the unique id to be the unique target for both of the importers (user and profile).
What am I missing here?
-Trevor
Comment #22
dave reidNo patch here to commit.
Comment #23
mukesh.agarwal17 commentedI've been struggling with the same thing for quite some time. However, I'm not using the profile2 module and instead have my custom entity which is related to the user. I came up with the idea of allowing multiple types of entities to be imported at the same time. So, when you are importing user entity, it would be great, if I can import my profile (another type of entity) as well. So, what I did is the following:
Attached is the patch. Please share your observation.
P.S. : I thought of writing a separate module first, and was half way through when I realized that this is more of a generic requirement and therefore created a patch to modify the base processor class. Will be great if the owner of the module can accept the patch.
Comment #24
bjlewis2 commentedMarking as "needs review" so that others know there is something here to test.
Comment #25
mukesh.agarwal17 commentedCorrected patch - the previous one does not do an is_array check before starting the for loop. Please provide feedback if you are able to test.
Comment #26
Anonymous (not verified) commentedI also get the error message "Notice: Trying to get property of non-object in FeedsProfileProcessor->getMappingTargets() " on Drupal 7.10.
However I'm using the latest dev (2012-Jan-07) of Feeds doesn't fix it like it did for the person in #19.
Any ideas there? I might have to try the generic entity importer if this doesn't work.
Comment #27
mukesh.agarwal17 commentedThe way I expect this to work for profiles is using FeedsUserProcessor. Anyways, can you please share the line number in which the error shows. You can find that in your php error log as well.
Comment #28
Anonymous (not verified) commentedSorry, I was actually referring to the module provided in #9. I'm going to try your patch next.
Comment #29
Anonymous (not verified) commentedJust noticed the second patch #25 is a lot shorter than #23. Is it complete?
Comment #30
mukesh.agarwal17 commentedThanks for pointing out, it was a silly mistake from my end when submitting the patch. The final one is attached here.
Note: This patch will not be applicable to profile import, unless the profile module changes its implementation of attaching the profile to user add/update (using hooks) instead of doing it only on form submissions. (See http://drupal.org/node/1394900)
Comment #31
Anonymous (not verified) commentedThanks. I successfully implemented the patch, however I get the following error message after going to the "Mapping" page. Under the user processor settings I have "Profile" checked.
Warning: Illegal offset type in isset or empty in EntityDrupalWrapper->spotBundleInfo() (line 676 of /Applications/MAMP/htdocs/vma/sites/all/modules/entity/includes/entity.wrapper.inc).
Comment #32
mukesh.agarwal17 commentedThe error seems to be with bundles. I'll write a new patch providing the options to select bundles as well.
Comment #33
mukesh.agarwal17 commentedUploading the new patch which works with entities + bundles. The problem with the previous patch was that I was not taking into account different types of bundles associated with each entity.
Hopefully, this one should work.
Comment #34
mukesh.agarwal17 commentedAahh, my bad.. Just saw the link to the patch and it was not complete. Please use the one attached here.
Comment #35
Anonymous (not verified) commentedFantastic, thanks - the patch works and I now have access to map Profile 2 fields through the Mapping section of a User Processor feed.
I ran through a test scenario with a single data row in a CSV file for an import. The user was imported successfully but unfortunately the profile fields are empty. I'm pretty sure I set up the mapping correctly - it's a few simple fields like "Name" and "Title".
What could I be missing?
Comment #36
mukesh.agarwal17 commentedNot really, the current implementation of profile is not supported with this patch. They update the profile of a user only via forms which I believe is not the best implementation. (See http://drupal.org/node/1394900). We will have to wait until profile2 module updates its implementation.
Comment #37
Anonymous (not verified) commentedI just found this - an in depth explanation of how to import Profile 2 fields into users - http://drupal.org/node/1285276
I haven't tested yet but it looks good.
Comment #38
wusel commented@afestein(#37):
The page of your link shows, how to import Profile 2 fields into users using "Migrate". This issue is, how to import Profile 2 fields into users using "Feeds".
That is different.
Comment #39
Anonymous (not verified) commentedUnderstood, but it's still worth mentioning in this topic for the benefit of others. After a couple of days of hair pulling it's the only solution I found that has worked for me so I thought I'd mention it.
Comment #40
Ale.bcn commentedHi mukesh.agarwal17 all the group:
trying to apply the patch i got:
# patch < feeds_generic_entity_import_v5.patch
patching file FeedsProcessor.inc
Hunk #1 FAILED at 419.
Hunk #2 FAILED at 454.
Hunk #3 FAILED at 475.
Hunk #4 FAILED at 487.
Hunk #5 FAILED at 501.
5 out of 5 hunks FAILED -- saving rejects to file FeedsProcessor.inc.rej
any ideas?
Comment #41
k_zoltan commented#40 Ale.bcn try patching the alpha-4 version, not the dev version. That worked for me.
Comment #42
TJM commentedHi K_Zoltan,
I haven't been successful importing profiles from Drupal 6 (csv file) into profile2 Drupal 7.12 with the feeds module (with patch). I was wondering what settings you used for Processor. What field did you use for the unique field?
All of my modules are up-to-date as of today. Also, My list of users has already been updated via upgrading Drupal 6 to 7. So, all I need to do is to add the profiles to already existing users.
Thanks,
Ted
Comment #43
Anonymous (not verified) commentedThanks for your nice little module! After commenting the call to dsm() in feeds_profile2_processor.inc , i am able to list the fields that I want to import using feeds import. :)
Comment #44
jainparidhi commentedHello everyone,
Could someone guide me how to accomplish this? I am confused with all the different patches and the modules.
In order to import users and their Profile2 fields into Drupal 7 from a csv file using Feeds, I need to install the Feeds module (dev release or the alpha V4 release?) and then install module from comment #9 above, and then use the "feeds_generic_entity_import_v5.patch" from comment #34 above? Am I correct?
What will the "feeds_generic_entity_import_v5.patch" patch? The original feeds module, or the module from #9?
Any help is appreciated! Thank you in advance.
PJ
Comment #45
Anonymous (not verified) commentedI tried to import from a csv file, and I'm absolutely sure the source attributes are correct since I could import data on the user account. But profile2 fields are not set (I verified in the database).
I run Feeds version 7.x-2.0-alpha5+38-dev, and Profile2 version 7.x-1.2. I also applied the v5 patch from #34.
Maybe I missed something in the configuration?
Comment #46
liquidcms commentedpatch in #34 appears in the UI to add support for profile2 fields; but it breaks being able to set any of the fields as the unique fields
Comment #47
liquidcms commentedand the values don't import.. but the UI is right.. :)
Comment #48
wickwood commentedI've applied the patch in #34 to the 7.x-2.0-alpha5 version of the feeds module and then merged that into the current 7.x-2.x-dev version.
I was able to map all the fields to the User and Profile2 fields I had created but upon trying to import I get this error:
Fatal Error: Call to undefined method stdClass::setuser() in /path-to-my-site/modules/entity/includes/entity.property.inc on line 428Anybody have any ideas how to fix this?
Thanks for any help in advance!
Steve
Comment #49
mattheweigand commentedSo the UI is right but none of the patches actually work? That is disappointing, because my client has asked for this functionality 2 days before the project deadline. I guess I'll have to keep searching for another solution.
Comment #50
ariran commentedsomething does not work :(
I established modules: FEEDs and FEEDS_SQL
after that i installed feeds_profile2_processor.tar_.gz and made feeds_generic_entity_import_v5.patch
in settings of Import i use SQL fetcher, SQL parser and User processor (becouse if i use Feeds Profile2 Processor, Mapping does'not work)
http://clip2net.com/s/2U3DI
after making Mapping for User processor i strat Import process and see User name missing or email not valid.
what problem can it be?
Comment #51
rosso69 commentedI used the patch from #34 and i get a list with all entity's. The only problem is that i cannot save the setting.
It unchecked everything.
Comment #52
moonray commentedI've taken a different approach that seemed more in line with how feeds has been doing things: I've added a new feeds parser to handle profile2 entities.
To import:
1) import your users using the user feeds parser.
2) import your profiles using the new profile2 feeds parser. Make sure specify either a uid, user name, or user email to link the profile to the user.
The patch can perhaps use better defaults for the parser config, and maybe some additional validation, but otherwise it works well.
Comment #54
moonray commentedOK, let's actually do that with the latest dev. Also fixed some notices.
EDIT: it probably still needs some tests.
Comment #56
moonray commentedAnd it would help if I ACTUALLY uploaded a patch that works with the latest version, instead of the same one.
Comment #58
moonray commentedNow with proper prefixes so patch system can apply them (let's hope).
Comment #59
andy_g commentedthanks @moonray for what I'm sure is an excellent extension.
However, I can't make it available in my list of parsers. Here's what I have done so far:
- installed feeds 7.x 2.x dev, profile 2 etc
- patched from #58
- checked that the file FeedsProfile2Processor.inc is in the /plugins directory
- cleared the cache and restarted the webserver
- created a new Feeds Importer
..but when I get to choose the parser, I don't have the new option for Profile2..any ideas what I've missed?
TIA, Andy
Comment #60
andy_g commentedDoh as usual the act of posting revealed all.....it shows up as a processor not a parser!
Comment #61
moonray commentedAh, yes, sorry. My bad. I meant processor, not parser.
Comment #62
andy_g commentedWorks a treat! Thanks moonray, your work really helped me.
Comment #63
HitbyHi,
Thanks for the importer. This is just what I'm looking for.
I have exported the user data from a set of D7 profile fields and then run them through the importer to get them into a profile2 profile. The importer runs and claims it has updated the correct amount of records (only 49) but the profile fields are still empty.
Any help would be appreciated.
Cheers!
Comment #64
michielkenis commentedSame here. I get a confirmation message, but no user profiles are created (nor updated)...
Comment #65
mikolaskova commentedsame happens to me. No errors. Users imported but profile fields not filled...
Comment #66
moonray commentedYou have to do the import in 2 steps.
1) import users using "User processor"
2) import profile fields using "User Profile processor"
You need to make sure your GUID (used as unique) is the same on both imports.
Comment #67
mikolaskova commentedthank you very much... but can I do this? Is there an additional module? (in the processor settings I can see only node, taxonomy and user)
I found a module, but it is for Drupal 6 only (https://drupal.org/project/content_profile_feeds)
Comment #68
mikolaskova commented...now I see that it's about Profile 2. I'm still using the core 'Profile' Modul.
But feeds behaves same way. Users are imported, no profile fields.
I tried to import the users twice with unique username (and update option)...but profile fields were not filled.
Is there a way to import these profile fields?
Comment #69
kyleoliveira commentedIn case anyone is interested in importing Profile2 profiles, but doesn't want to patch Feeds themselves, I've started a sandbox project that basically implements the patch from #58 in a way similar to Field Collection Feeds. You can get at it here: https://drupal.org/sandbox/kyleoliveira/2038851 . I just submitted it to the full project request queue, so any additional feedback would be appreciated. I'm kind of tired of waiting for this sort of thing to move forward with regard to contributed modules' entities and Feeds.
Comment #70
Whiskey commentedThanks Kyleoliveira!
There seems to be a typo in your module; I had to rename the class and file of the class to Profile2_FeedsProfileProcessor (with underscore) to make it work. Excellent though!
Comment #71
kyleoliveira commentedWhiskey,
Good catch! I've fixed that in the commit I just pushed.
Thanks!
Comment #72
nasia123 commentedIt would be also nice to add a mapping for a Profile2 Privacy field
Comment #72.0
nasia123 commentedi correct a typo
Comment #73
ibit commented58: feeds-profile2_integration-1228062-58.patch queued for re-testing.
Comment #74
Chipie commentedThanks moonray. Your patch works great.
Comment #75
twistor commentedThe patch looks pretty good, but this should happen in the Profile2 module, also, it can take advantage of the new entityprocessor as well!
Comment #76
joelstein commentedFYI, there's now a module called Feeds Profile2 which extends the built-in User processor so that Profile2 profiles can be created and updated as part of a user importer. Maybe it can serve as a stop-gap solution until proper support is added in Profile2?
Comment #77
rcodinaModule Feeds Profile2 worked for me!!! Thanks @joelstein!
Comment #78
kenorb commentedComment #79
hkovacs commentedpatch @58 works for me.
module feeds profile did not work for me.
Comment #80
rcodina@hkovacs There are patches available that improves Feeds Profile2 integration with Field Collection, etc
Comment #81
delacosta456 commentedhi Guys
I had just notice today that when name field is attached directly to user account all component are available in feeds .. but when name field is attached to a profile only the Name field itself is available.
shall we report this to feeds guys or profiles2 guys
Comment #82
delacosta456 commentedhi
Patch # 58 worked for me to on Panopoly distribution.
But i would like to suggest (if possible) option to select one or more bundle ... and let selected bundle's field available for mapping.
Comment #83
rickj commentedThis functionality is provided by the Feeds Profile2 module. It creates a fully integrated solution, despite being a separate module.
Comment #84
damienmckennaFor anyone who needs it, this is #58 (which is a patch for Feeds, not Profile2) with a fix for a API compatibility problem with the latest Feeds codebase.