I'm trying to combine the data for a user with their data as a customer (name, address, etc). For ordinary users, this info is required so I show the "customer profile" form to fill in this info, when the user is registering.
However, customers are not the only type of users. There are also the people who work for us, and for them, having such a profile is nonsense. For this kind of user I'd provide a special role, "staff".
However, I am no longer able to create a new user, neither for myself when logged out, nor as an administrator, without having to fill in the required fields for the customer profile.
Not showing the form at user registration time registering removes the problem, but then, ordinary users (without role "staff") don't have to fill in this form either.
Am I overlooking something, or is this suitable for a feature request?
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | profile2regbypath.zip | 1.23 KB | halmsx |
Comments
Comment #1
iainhallam commentedSubscribing
Comment #2
Fredrik A commentedsubscribing
Comment #3
robbiePie commentedsubscribing
Comment #4
juliakoelsch commentedsub
Comment #5
meabbasi commentedsubscribing
Comment #6
fagoProfiles work perfectly fine per-role, what you want are per-role registration forms. That's definitely stuff for a 3rd party module that takes care of it. There were modules like auto-assign-role or rolesignup that do that for d6.
I'm leaving this issue open though, so it can serve as a collaboration place for people interested into that.
Comment #7
ltiong commentedsubscribing
Comment #8
TahitiPetey commentedChanged the thread name to "Provide per-role registration forms", from "Provide pre-role registration forms".
Comment #9
halmsx commentedhi
ive just created a simple module for this as i needed it urgently and the d7's autoassignrole does not provide that function yet.
i actually just modified profile2_form_user_register_form_alter and add create a new sub module for it. path infos are stored in a table (structure in .module file).
it work by the register url. by default, its "user/register/". but if you add to it like "user/register/company", it will search the table for a corresponding path, "company" or arg(2), get the profile type, and attach the form to the registration form.
default registration form is displayed if no additional path is added or no matching path is found.
WARNING: if you checked "Show during user account registration", that profile form will be displayed in "all" registration forms, regardless of the paths.
its a startup and it works. but yes, aint perfect yet. need more stuffs like admin page, install file, and better module name!
i purposely want to manage the path manually coz i need to manage it for my own purpose.
if this looks ok, feel free to create a new project for it, im too busy to do it at the moment. another reason is also coz this is just a simplified version of profile2_form_user_register_form_alter function found in profile2.module, so im not sure if this can be considered another module.
leave comments here, if any, and ill try to reply soonest possible.
enjoi/
Comment #10
spgd01 commentedsubcribe
Comment #11
halmsx commenteddiscovered a problem with my sub module.
for uploads, image and file field types, im getting ajax error. found the problem, will fix it later.
Comment #12
zmove commentedThank you halmsx, I had the same need. I will test your module and I subscribe to that post to follow the updated.
For my 2 cent, I don't understand why you find it's the role of a contributed module to do that. IMO, it's the same option as "display on registration form" and that option is included to core profile2 module.
Regards,
Alex
Comment #13
halmsx commentedhey alex,
this function used to be provided by autoassignrole module. also, in comment #6, fago said its "definitely for 3rd party module..." besides, this is still work in progress for me. i prefer to separate it as its easier for me to work on it. im hoping someone can decide what to do with it as my brain is on something else at the moment.
Comment #14
halmsx commentedhi,
was unable to fix the file upload issue. the problem is in the core's file module. i found this patch, applied it manually. its working fine now.
if you have "required" radio buttons in your form, make sure you select a default value (do NOT select "N/A") or you will get "illegal choice" error.
currently, this allows only one to one assignment.
profile a => role 1
profile b => role 2
profile c => role 3
not sure where to add this. profile2 contrib module? separate module? autoassignrole?
Comment #15
alejandro_oses commentedexcellent halmsx, really helped
Comment #16
grasmash commentedhalsm,
I've started a project based off of your idea for profile-specific registration paths.
http://drupal.org/project/profile2_regpath
Just released the project today. There should be a nightly build created tonight. If I get some decent traction, I'll make an official release.
Comment #17
halmsx commented@madmatter23 just saw the post today. havent tested the module yet. will do it real soon.
Comment #18
barrapontoContributed module http://drupal.org/project/profile2_regpath fulfills this Feature Request.
As for
admin/people/create, it follows up at #1413608: Add separate settings for including form on user registration page and admin add user page.Comment #19
brightbold+1 for Profile2 Registration Path. It has worked well for me on projects where I needed this functionality.