Reviewed & tested by the community
Project:
Complete profile
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Mar 2012 at 20:48 UTC
Updated:
5 Aug 2016 at 19:35 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Andre-B+1
subscribe
Comment #2
dave reidI don't use profile2, so I would need someone else to write the patch for it, but then I can at least review it from a code level.
Comment #3
jaxpax commentedI'm sorry I can't be of any help there. I would, but I can't.
Comment #4
oystercrackher commented+1
Comment #5
dave reidI just committed the concept of 'Controllers' for complete profile, so that the logic for 'does this user have any fields that are empty' and 'give me the form fields for the user to fill out' is abstracted and separate. It should be easy to write a Profile2CompleteProfileController for someone familiar with the profile2 code base.
Comment #6
achikas commented+1
Comment #7
moehac commented+1
Comment #8
aitala commentedIt would be a useful addition.
Eric
Comment #9
dave reidHey everyone, rather than adding more +1s and comments that this would be useful, you can use the big subscribe button at the top right of this issue, without needing to add a comment. No need to add more noise and e-mails unless we're actually making progress on this issue.
Comment #10
poukram commentedI try to write a Profile2CompleteProfileController. I just test few things and it's work for me.
I'm not an expert in profile2, maybe I've done silly things.
we have to add this in complete_profile.module
and this in complete_profile.info
a new file to add in includes directory => Profile2CompleteProfileController.php
and the content :
Comment #11
stewart.adam commentedAttached patch (against 7.x-1.x git) adds a new module complete_profile_profile2 that adds support for profile 2.
It is based on poukram's code in the previous comment, however I have made a few modifications as my use case required that each profile type be placed in a collapsible fieldset. I also have modified it to to use
profile2_category_access()so that if a user has required fields on a profile but has not yet entered any data at all, this will pick up on that and have them complete it. Previously, the code would only detect incomplete fields in existing profile entities.Comment #12
sayela commentedHi stewart.adam,
Thank you very much for the effort. Your solution somehow did not trigger the Complete your profile warning for required profile2 fields until I added a new required field to the default user account settings. Please is this normal or I missed something?
Comment #13
stewart.adam commentedIt worked for me without having to re-save the profile type, but it's quite possible I missed something. I'll do some testing to verify if I can reproduce your issue locally.
Comment #14
System Lord commentedThis seems to work. However, when a user clicks their one-time-login the first thing that come up is the empty required fields. Then once they save those entries they are taken to the "Account" page. This seems/feels backwards. I was expecting normal behavior through setting password, then after "Save" users would be directed to Complete Profile. I could except this i suppose, with additional instructions in their "one-time-login" email. But, I think all would flow naturally, and without additional instructions, if Complete Profile occurred after setting and saving the password.
I don't suppose there's a simple fix/adjustment?
Comment #15
ronaldmulero commentedExcellent idea System Lord - Mark (comment #14).
Adding 'user/*/edit*' to the exclude paths array in line 124 of the complete_profile.module fixes this.
Here's the patch.
Created with git format-patch
Comment #16
Andre-B@ronaldmulero do not assign yourself to the ticket unless you can test, review and commit this one by yourself.
Comment #17
System Lord commentedI was rereading my #14 over and over trying to remember what the heck? My site doesn't flow this way. Then I remembered I am using project/email_registration (now). This module puts the password fields in the registration form. So, now after the user clicks the one-time-login they are presented with required fields and they don't need to be directed to the user account page to set password.
Now I'm wondering if your "fix" patch will interfere with this flow lol (?)
Mark
Comment #18
ronaldmulero commented@Andre-B
I got carried away. :o)
@system-lord-mark
Since your users wouldn't be redirected to user/*/edit* after clicking their one-time-login link, I believe the required fields would still be presented as before.
On the other hand, if users were to type "user/[theirusernumber]/edit" into their browser address bar at any time after using their one-time-login link, they would still be able to access their account edit page.
Comment #19
asb commentedHow are the chances to get #11 commited to dev?
Comment #20
user654 commented.
Comment #21
user654 commentedI tried patch from #11 and enabled the new module (Complete profile-profile 2).
However I cannot make it work,even after adding a new required field.
Am I missing something?Shall I attach the profile to a role so as this works?If so,how?
I am also using Email registration module.Could this be the reason not working?
thanks
Comment #22
System Lord commentedI'm using Email registration and mine works fine. Patch #11 should be what you need
with #15 patched after."Shall I attach the profile to a role..." Since CP works after registration I'd imagine you already have a role assigned at that point. (or explain what you mean by this)
If your using #15 make sure you haven't enabled "bypass" in permissions.Comment #23
user654 commented.
Comment #24
System Lord commentedActually I don't think it matters. I thought #15 made a change to #11 but it doesn't. They're independent of each other.
As for you second paragraph...This is where "Bypass complete profile module" permissions come in handy. Just check the roles you want to exclude from this module.
Comment #25
user654 commented.
Comment #26
System Lord commentedYep, I forgot it was also a patch.
https://www.drupal.org/node/1942562
Comment #27
user654 commented.
Comment #28
System Lord commentedThat I can't help you with. I do all my patching manually so I don't know what that command line does. Based on everything you have described you need to apply the patch in #26 and check the roles you want CP to bypass.
Or is CP not working at all with any roles and any required fields?
Comment #29
System Lord commentedMaybe run updates and also test on a new account (?)
Comment #30
user654 commented.
Comment #31
user654 commented.
Comment #32
antonyanimator commented#11 worked for me great.
Just remeber that the patch results in the need to enable a sub module
Comment #33
user654 commented.
Comment #34
antonyanimator commentedPretty straightforward, when you edit a profile2 type but you shouldn't be asking that in this issue queue as its not relevant.
Comment #35
spanners commentedHaving no luck with the user being asked to fill in the Profile2 fields. I applied patch #11, enabled the profile2 support module and after no luck, also applied patch #15. I'm using the dev version of this module.
But the user is never prompted to complete the Profile2 fields (I have three different profile types, all with unique, required fields).
I even tried putting the profile2 fields in a collapsable field set. No difference.
I checked the permissions and each role/profile type has permissions to View own profile, View any profile and Edit own profile.
Am I missing something? Or am I just out of luck because it doesn't work with HybridAuth?
Comment #36
chrisrockwell commentedPatch in #11 applied to -dev works well for me. I'm wondering if this module would be better in complete_profile/contrib/ instead of being stand-alone?
Comment #37
chrisrockwell commented@Spanners, what happens when the user logs out (after completing required fields on core User) and then logs back in - are they then taken to user/[uid]/complete-profile?