Hi there,
I'm working on showing a registration form during the checkout process of Ubercart. I've set up content_profile to show the fields on the normal registration and it works fine (thanks for a great module btw). Unfortunately, calling user_register() to build the form during checkout doesn't display the content_profile fields because the content_profile code for this is in hook_form_alter() instead of hook_user('register').
I'm proposing that the code be moved to be more inline with core thus allowing system extensions to automatically get the 'content_profile injected' registration fields.
If I get enough +1's i'll move the code myself (I have a sponsor for it). I'm aware of another issue that will involve changes to content_profile_registration. #307639: All node fields/taxonomy/etc on registration form
Comment | File | Size | Author |
---|---|---|---|
#2 | 410678_200904041803+1100.patch | 6.68 KB | sammys |
Comments
Comment #1
NikLP CreditAttribution: NikLP commentedI'd like to see this, if only to experiment and see if it actually works. To my mind, there's been zero activity (of use) on the c_p_r module for some six months now, and it needs to move on.
Further to my comment on the "other" thread about this (http://drupal.org/node/307639) I am led to believe this is the correct way forward in any case.
Comment #2
sammys CreditAttribution: sammys commentedHi there NikLP,
I've implemented a prototype of this feature (i.e it's really yucky) to get a client's project out the door. It only does one c_p node type at this point. In any case, the code works as expected. Here is a patch of what i've done so far. I had to remove the field groups for the client so that stuff can be removed in the end result.
I'll refactor this to be more complete if I get time. I've left the old hook_form_alter() code there as a reference until it gets cleaned up.
--
sammys
Comment #3
fagoI'd be open to that change, but please keep it separated from any other changes.
Comment #4
mnlund CreditAttribution: mnlund commented+1 for this!
I've struggled to include some content profile fields in the welcome email, and with this approach it's no problem at all! Thanks!
Comment #5
NikLP CreditAttribution: NikLP commented@fago What's the score with this? Don't the recent changes you made make this issue null & void?
Comment #6
fagoYep, it does. It's not in hook_form_alter() now, but the code is separated better and easy to reuse - so this isn't necessary any more.
Comment #7
cnolasco CreditAttribution: cnolasco commentedgreat, solved my problem.
best regards
Comment #8
mnlund CreditAttribution: mnlund commentedThis has to go into the codebase. I.e. content profile fields in rule sets on user creation doesn't work without this. Please commit this very useful patch.
Comment #9
NikLP CreditAttribution: NikLP commentedAFAIK this issue is no longer relevant.
Comment #10
hanoiiBringing this one back to life, although haven't seen much activity on this module lately, but.. I think this might be a good approach. I am also now going through some Ubercart development and I found a different use-case with the same need. Ubercart can create an account when checking out some products, which uses user_save() to store the new account details. Wouldn't be the logical approach that this module could create accounts on hook_user rather than on a form_alter?
I think I am going to sort this on a helper module, but just wondering.
Comment #11
hanoii