Hello all,
When generating users with Devel that have profile content using Profile2, content in the profile types is not generated. Is there a way to do this with the current Devel?
Thanks for reading,
-Tim
Hello all,
When generating users with Devel that have profile content using Profile2, content in the profile types is not generated. Is there a way to do this with the current Devel?
Thanks for reading,
-Tim
Comments
Comment #1
salvisProfile 2 would have to implement that.
Comment #2
zkday commentedYes,
This is need feature, I'm worked add this is patch file for this feature.
Comment #3
zkday commentedChange status.
Comment #4
kthullOoh, perfect timing...subscribing.
Comment #5
m4oliveiThanks for the patch. When generating profiles with images or files, it fails with a bunch of errors. Just add an image to a profile type to reproduce.
Comment #6
fago+1 for adding something like that. Here is a first review.
Trailing whitespace.
Make sure the comments match the coding style.
Whitespaces in empty lines. Also in many others.
I think selecting users by role should do it + providing a numeric limit. E.g. "create max. 50 profiles".
Let's call that replace existing profiles.
Coding style.
Remove that.
This needs to go via entity_create()
the save function does not return an id.
What should this comment tell me?
Wrong indentation.
Comment #7
zkday commented@fago thanks for the comment.
I rewrite another code for this features and fixed coding standards!
Comment #8
bjalford commentedAdded description to menu link
Comment #9
bjalford commentedComment #11
zkday commentedAdd description for menu link and fix another comment in code.
Comment #13
zkday commentedSorry, i'm update the patch!
Comment #14
zkday commentedchange status.
Comment #16
zkday commented#13: profile2-add_devel_generate_for_profile2_content-1276820-p5.patch queued for re-testing.
Comment #18
aniebel commentedI'd like to use this. How can one tell what caused the last patch to fail?Ok, I successfully patched using #7 however, can you tell me where I might find these generated profiles? It appears it's generated 50 profiles but without associating with a User, I am unsure how to access them.
EDIT: I had previously created 50 users via Devel Generate and the 50 Profiles I created populated using those User IDs. Thought I would submit my findindgs.
Comment #19
manarth commentedPatch rerolled against latest dev.
@aniebel - I've just tested profile2 with this patch...I created 20 users through devel (before patching profile2); patched profile2 then generated 20 profiles. These were all properly associated with the users. Maybe try the new patch?
Comment #20
funkym commentedI had the same issue as #18, turns out the user ids they were not getting passed properly by array_rand (which returns the array keys and not the user ids). I simply switched array_rand to array_slice and it got rid of the issue.
I also cleaned up the title and added a description to profile2_menu()
Comment #21
varunity commentedThanks funkym, I applied the patch, cleared cache and can now generate profiles.
Comment #22
micheSuccess using patch in comment #20. Thank you!
Comment #23
braindrift commentedThere shold not be more than one porfile of a type for one user. After applying this patch, i generated profiles two times and now some users have more than one profile of the same type.
Comment #24
braindrift commentedComment #25
kingfisher64 commentedI'm not sure what #22 is saying to be honest.
Is the patch in #20 not ready to be committed then? It works lovely for me. Not experienced any problems. Maybe I missed something.
Comment #26
braindrift commented@kingfisher: do you mean #23? If it is so, then I would say NO, because multiple profiles are generated for users if you run it multiple times.
Comment #27
kingfisher64 commented@dendie - yes sorry, I mean #23. Ok that does need fixing, would be v handy to have this working correctly.
Comment #28
kingfisher64 commentedWould anyone be kind enough to advise me on how to clear up profile2 profile content generated?
I've removed the users and content from within the admin however I get the following errors:
I applied the patch to be able to create users, however the content for those users is still left over in the view.
**** Edit **** Fixed by adding vbo field with delete option to the view and deleting the left over content.
Comment #29
joshf commentedThe attached patch prevents duplicate profile types per user from being generated. It also ensures that the user-defined limit is always respected.
Comment #30
joshf commentedComment #31
spleshka@joshf,
Thanks for your patch. I reviewed it, fixed coding stardarts issues, and then made a workaround with several changes for profiles generation. In generaly, I used your patch as a base for a new one. Now it is commited/pushed to 7.x-1.x.