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?

CommentFileSizeAuthor
#9 profile2regbypath.zip1.23 KBhalmsx

Comments

iainhallam’s picture

Subscribing

Fredrik A’s picture

subscribing

robbiePie’s picture

subscribing

juliakoelsch’s picture

sub

meabbasi’s picture

subscribing

fago’s picture

Title: Make profile only required for users with/without a specific role » Provide pre-role registration forms
Version: 7.x-1.0-beta3 » 7.x-1.x-dev

Profiles 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.

ltiong’s picture

subscribing

TahitiPetey’s picture

Title: Provide pre-role registration forms » Provide per-role registration forms

Changed the thread name to "Provide per-role registration forms", from "Provide pre-role registration forms".

halmsx’s picture

Issue tags: +autoassignrole, +profile2, +Profile role integration
StatusFileSize
new1.23 KB

hi

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/

spgd01’s picture

subcribe

halmsx’s picture

discovered a problem with my sub module.

for uploads, image and file field types, im getting ajax error. found the problem, will fix it later.

zmove’s picture

Thank 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

halmsx’s picture

hey 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.

halmsx’s picture

hi,

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?

alejandro_oses’s picture

excellent halmsx, really helped

grasmash’s picture

halsm,

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.

halmsx’s picture

@madmatter23 just saw the post today. havent tested the module yet. will do it real soon.

barraponto’s picture

Status: Active » Fixed

Contributed 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.

brightbold’s picture

+1 for Profile2 Registration Path. It has worked well for me on projects where I needed this functionality.

Automatically closed -- issue fixed for 2 weeks with no activity.