Found a small issue with my selected role not being assigned after uploading a file on the registration form (I have an image field on the registration form which is attached to the user and not the profile).
On line 377 of profile2_regpath.module, $profile_types will only be retrieved from the $_SESSION['p2rp_profile_types'] array if arg(0) == 'system', but for me arg(0) is equal to 'file' (arg(1) is still 'ajax').
My quick fix was to look for both:
if (!$profile_types && in_array(arg(0), array('system', 'file')) && arg(1) == 'ajax' && isset($_SESSION['p2rp_profile_types']))
fwiw. I noticed the dev version also looks for 'system/ajax' on line 487.
Comments
Comment #1
grasmash commentedThanks for pointing this out, I hadn't realize that ajax file uploads use a different system path.
I've made a fix for this in 7.x-1.x-dev based on your suggestion.
Comment #3
2phaIs this still an issue?.
I had this module working fine until I added an image upload to the profile, now the role does not get assigned. (Image field is assigned to the profile, not the user form)
I am using 7.x-1.11
I am also using field groups if that makes a difference.
Comment #4
2phaI changed
to
And all seems ok, though there probably needs to be some more "if" logic within this "if" so unnecessary processing is not done
Comment #5
jdanthinne commented#4 Working for me.
Comment #6
grasmash commentedThanks for the info.
I've believe that I've fixed the bug, although I did not use your snippet.
Please check the latest dev version and let me know if you experience any problems.
Comment #7
2phaTested 7.x-1.x and it seems to work well.
After looking at your commit comments I had to look up the word "kruft"...it gave me a laugh, and taught me a new word :)
Comment #8
grasmash commentedHah,
I actually meant to write "cruft," but Urban Dictionary's definition of "kruft" could apply in some metaphorical sense.