how would i go about setting up a content type for role 1, and another content type for role 2 for the registration form?

allowing the role to create a profile once logged in is simple, and establishing the permissions is easy too, however, i would like to ask for certain fields on the registration page. so, if i were to have an url, user/register/role1 would ask for questions pertaining to role1, and user/register/role2 would ask for different fields.

writing a module to filter on arg(x) i guess is how, however, how do i go about spitting out the correct fields for the different content types?

thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

George2’s picture

Version: 6.x-1.0-beta2 » 6.x-1.x-dev
FileSize
7.75 KB

ok, i've spent today writing a bit of a patch to allow the admin to allow different content profiles to be used during registration

new features added:

checkbox added to 'content profile' form for each node type. adding the option to access the profile during registration from url, also displays the url of how to access the registration form for this content type. nb. "use on registration" must be checked as well to be of use (maybe enhance with js to disable this field until "use on register" is checked?)

menu item added (admin/settings/content-profile/registration) in site configuration to allow user to choose a default registration content type for user/register. also, text field added to allow user to silently append a string to the user/register/foo argument so that content profiles can be given a naming strategy within drupal. ie. i've ended all my profile content type machine names with _profile, so user/register/foo will show the fields for foo_profile (to make urls look nicer)

if user tries to access user/register/some-random-string, a 404 will be returned.

---
i hope i've not strayed too far from content profile registration as i think this will be potentially useful to all users of the content profiles registration module if they have more than one user role to sign up to the site.

thanks for the module!

George2’s picture

Status: Active » Needs review
fago’s picture

hm, I'm not sure about how to solve this. Also see http://drupal.org/node/301464 for a discussion.

I think integrating with a "rolesignup" like module makes sense. I'm not sure if just providing the paths is clever, as it doesn't grant user to roles. So perhaps it's better to let a module like rolesignup or whatever do that and the integrate in these pages.

George2’s picture

not auto granting roles is fine, because if someone signs up to a particular high roletype, i would like to add them manually in the admin - rather than the role being granted depending on what url they were sent to!

however, the above discussion is interesting

George2’s picture

there's also a bug here as the module doesn't check to see if arg(0) is 'admin', which is important here because arg(2) if it exists, is expected to be the name of a profile to get the required fields, so a simple && arg(0) != 'admin on line 14 should make fix.

NikLP’s picture

@fago - rolesignup would have been perfect, but it is deprecated in favour of autoassignrole. I'm not sure what the security implications are that were mentioned.

Comments about the workflow etc here: http://drupal.org/node/301464#comment-1032416

kenorb’s picture

There is other solution to do that.
When you have different roles, try to change permission for creation specified content type.
But you need to use this patch:
http://drupal.org/node/314855
http://drupal.org/files/issues/content_profile_registration.module.patch

kenorb’s picture

I've tried to make patch working, but without result.
I've modified this patch (to compatible with path module) and added some additional fixes and now it's working ok.
Patch and whole file included (because it's smaller than patch;).

Just rename 'some_path' to 'some_path/content_type_name' (which is included on Registration form of course).

Files in attachment.
Updated date: 16.10.2008

kenorb’s picture

BTW. development version of autoassignrole have functionality to assign different roles depends on path.

cyberswat’s picture

subscribing

farald’s picture

subscribing....

daneyuleb’s picture

Patch on #8 works for me as long as the pathname (ie, "my-role_registration") matches the name of the content_profile.

If you have more than one content type assigned to be on the registration form for different roles, and those content_profile types have a different name then the last arg of the path you assigned, you get all content profile fields for all roles on the registration page. That mismatch throws it into assuming "use for all roles" in effect for the "use on registration" field.

NikLP’s picture

that would be a good reason to assume it's not even worth trying then, eh?

kenorb’s picture

In development version of autoassignrole there is small improvement for content_profile module (additional form_alter functionality), so you can choose which content type should be appear on which registration form.
I haven't tested it too much, but you can try.

daneyuleb’s picture

I wouldn't say it's not worth trying at all--in fact, it works fine for me, as long as I make a few very small changes.

(I'm posting this on both Content Profile (#313241) and AutoAssignRole (#301464) threads related to the subject, since they seem to be focused on the same thing and maybe this info will help. I think once all the varied peices are updated to fix the below with something more than my hacks, it will be a solid solution.

The intent here is to be able to designate a URL which when used will take the new user to a registration page containing fields specific to a given role, and auto-assign that role to him when he submits it. The scheme uses Content Profile, and AutoAssignRoles.

I'm using the current dev version of AutoAssignRole and Content Profile (6.x.1.x)

These are what I had to do to get it to work for me...your mileage may vary:

---- Changes in: autoassignroles.module

$path = request_uri();
...to...
$path = drupal_get_path_alias($_GET['q']);

..and..

$path = substr(request_uri(),1);
..to...
$path = drupal_get_path_alias($_GET['q']);

(These are to get it to handle path aliases right when figuring out how to assign role by the path used to get to page.)

if ($type) {continue;}
..after..
foreach ($profile_types as $type => $typename) {

(This is to avoid a callback error when it calls drupal_retrieve_form...not sure exactly why it's getting a bogus callback, but this change fixes it with seemingly no ill effects but this probably isn't optimal)

--- content_profile_registration.module

I used a modified module supplied in #313341 by kenorb (thanks!) to allow proper use of content profile stuff on registration page mostly by fixing some path alias issues. Not absolutely sure it's needed--put it in before i thoroughly tried the base module.

Finally, I had to remember to assign the URL used to get to the login page (the one you set in the AutoAssignRole path field) to be the same as the content profile "type" name I used when creating the content, or it will act like "All Registration Forms" is in place and you'll get content from all the content profile's that you've set up to be on registration forms. Looks like it's trying to match the content type to the last argument of the path in "content_profile_registration_form_alter" in the content_profile_registration.module. In other words, if I call my path in autoassignroles /sites/fan_registration...the type name of the content I'm pulling the fields from needs to be "fan_registration".

momper’s picture

subscribe

loze’s picture

subscribing

Liliplanet’s picture

subscribe

OneTwoTait’s picture

Auto Assign Role gets the job done... but having a special URL for seperate roles would be nice.
(subscribe. :P)

kenorb’s picture

Project: Auto Assign Role » Content Profile
Component: Code » User registration module
Status: Closed (fixed) » Needs review

There is already this functionality in AutoAssignRole (test on dev version).

kenorb’s picture

Project: Content Profile » Auto Assign Role
Component: User registration module » Code
Status: Needs review » Closed (fixed)
kenorb’s picture

Project: Content Profile » Auto Assign Role
Component: User registration module » Code
Status: Needs review » Closed (fixed)

There is small issue related to integration of content_profile with autoassignrole.
If somebody interested and had similar problem, please confirm this patch:
#319043: Page is redirected to existing user profile on creating profile for another user

bgogoi’s picture

just found this: http://drupal.org/project/profile_role

Anyone has used this?

kenorb’s picture

Project: Content Profile » Auto Assign Role
Component: User registration module » Code
Category: feature » support
FileSize
3.69 KB
7.99 KB

Try this one updated with latest version.
Read: #1 #12 #15 for some more information what's improved.

kenorb’s picture

Project: Auto Assign Role » Content Profile
Component: Code » User registration module
Category: support » feature
Status: Closed (fixed) » Needs review
NikLP’s picture

Project: Auto Assign Role » Content Profile
Component: Code » User registration module
Category: support » feature

What the hell are these files? :)

bcn’s picture

Status: Needs review » Needs work
FileSize
9.11 KB

Re-roll of the patch from #24. I made a few small changes for coding and comment style.

I've tested quickly and found that I was able to register at the path (eg user/register/[machine-name]) setup in AAR, a profile was created and the user got the appropriate role. First off, good work (and big thanks) for you work on this patch. I then went to test what happens at the standard registration path (ie user/register), and all the fields from the profile are still there. I'm not sure if this patch was addressing this issue or not, but to me it seems that we wouldn't want the profile fields to show up there if we're using AAR and a special registration path for each profile type.

I'm also not so sure there is need for the new settings page added at /admin/settings/content-profile/registration, especially the part to append a string...

kenorb’s picture

For those who wants to include register form as block (even when you are logged in) -> formblock module is the solution

BTW. #27,
maybe because there are couple of patches pending and were not committed yet for AAR:

This one: http://drupal.org/node/321110#comment-1199996
This one: #337059: Show correct profiles for user roles (I haven't test this one yet).

Or there is another solution how to make permission which role should see which registration forms: http://drupal.org/node/321099#comment-1062117

Tell me which solution worked or not.

andreiashu’s picture

I created a new issue that is related with this one but addresses the problem for the base module instead of the "User registration" module.
You can find there a patch: #375454: Make CP role aware
I was thinking that maybe making the base module role aware it would be useful for the user registration module and/or AAR.

sumitk’s picture

subscribing

m@rtijn’s picture

subscribing

riverfr0zen’s picture

It's been some time since the last patches, and the issues appear to be quite many. I've done some work recently on this, and seem to have a working solution.

It incorporates various patches (thanks to those developers) and further fixes not just from this issue, but a few others related toward the same goal, i.e. getting the correct content profiles to appear on registration. I'm submitting my patches below, not just for content_profile, but also for autoassignrole (I'll be posting to a relevant issue for that module also shortly -- just adding here also for convenience). These are to be applied against the latest dev versions as of this time.

Since the issues behind getting this to work seem so sprawling (probably more so while developing than after :), I'm also going to try to provide some instructions that sum up how to get everything to work.
------------

General:

1) You need to apply these patches to the latest dev versions of content_profile (6.x-1.x-dev, 2009-Apr-07) and autoassignrole (6.x-1.x-dev, 2009-Apr-02)

2) If you have already installed autoassignrole, you will need to uninstall before applying the patch (be sure the autoassignrole and autoassignrole_page tables are dropped, and that the entry in the system table for the module is cleared also), and then reinstall the patched version.

------------
Auto Assign Role:

1) Once installed, go to Administer > User Management > Auto Assign Role

2) Under Assign from Path, there is a new option (introduced in this patch): 'Registration page as portal'. This feature is OPTIONAL, you don't have to enable it. Selecting it, however, will mimic the behavior of the old rolesignup module, in that it replaces the default registration page with a page displaying the roles available for registration. This replacement registration page can be themed by overriding the autoassignrole-registration-portal.tpl.php template (a new file in this patch).

3) Still under Assign from Path, enable each role you want to make available during registration. It is important that the 'Path' for each role is set to user/register/machine_readable_content_type_name. For example, if you want to enable a type with the machine readable name 'ace_investigator' for a role, the path should be user/register/ace_attorney

------------
Content Profile:

1) The changes here probably won't work well if you have the Content Permissions module enabled, because of the way field permissions are implemented. They may, but I haven't tested that yet.

2) Make sure permissions are properly set. Under the 'node module' section:
- For each role to be available during registration, allow its 'create some_content_type' permission for anonymous users.
- Obviously the 'edit own some_content_type' permission should be available to the roles using those content types for profiles.

3) Modify each content type being used as a profile as follows:

Under 'Edit tab', under 'Content Profile':
- Be sure to check the 'Use this content type as ...' option
- Be sure to set the 'Path' option to the appropriate one for this type (TODO: in the future, it may be good to be able to assign a type to multiple paths here)
- Remember to save after this.

Under the 'Content Profile' tab, under 'User Registration':
- Check 'Use on Registration' and 'Use URL argument to select ...' option, and be sure to save.

Other notes:
- I found with Content Profile that some fields in a type that were not in a field group would not appear during registration, or under the 'Hide these fields ...' area under the type's Content Profile settings. I was able to workaround this problem by putting those fields in a field group. I think this (or something related) is a known issue, but haven't had time to look into it.

------------
Ok, that's it. Hope you guys can try this out, and let me know if I missed anything!

riverfr0zen’s picture

Status: Needs work » Needs review
iant’s picture

FileSize
7.73 KB

@riverfr0zen,

Thanks for this it looks very good. Trying it on my development site http://development.grampianlocums.org.uk/

Some questions on how I set this up. If I enable anonymous user access to create user_role_a and user_role_b then I get a create content item on my home pages that lets people create content for these types not associated with a user registration - can you suggest how I stop this showing up ?

I like the choose a registration option page, but can you get it to include the description of the roles ? I've put in description of the content_type when I defined them in CCK but it doesn't seem to show here.

when I click through to the user/register/user_role_a registration page whilst it does have the fields for the content type for user Role in the page it also seems to have tabs for both that type and the other one so I get a header reading as in the picture attached. Have I got this configured wrong ?

Thanks for your work on this one.

IanT

riverfr0zen’s picture

Thanks for trying it out, iant.

You should be able to configure the items under the 'Create content' menu at Administer > Menus > Navigation. You could, for e.g. disable the sub-menu items under 'Create Content' that pertain to your content profile types. You could also disable the entire 'Create content' menu item, and create your own one, and make it permissions-based through the 'Blocks' administration. There are quite a few ways to mix/match with those two admin tools that you could try out. Of course, this does not do anything to address the fact that an anonymous user who somehow goes to 'node/add' of their own accord will see links to create content of those types. There are ways to address that, but probably for a future iteration.

To get rid of the tabs, I suspect under the Auto assign role settings page you have selected each role's Display Method option to be 'Tabs on registration page'. Can you confirm that, and if so, try changing them to 'Pages with no navigation' instead?

Good point about including description. Should put up a patch to include that in a couple of days or so. In the meantime, would appreciate it if everyone could keep reporting any other issues here. Thanks.

jdave2417’s picture

Category: feature » bug
FileSize
15.12 KB
16.9 KB
13.49 KB

riverfr0zen,

I've tested and retested your patches and, unfortunately, have been unsuccessful. Hopefully the problem is on my end. But either way, here is the breakdown-

I'm using XAMPP/apache server on windows.

PROBLEMS
#1. While accessing my admin area and when I update.php, I receive the following error at the top of the drupal page/in the box:

user warning: Table 'drupal.autoassignrole_page' doesn't exist query: SELECT rid, path, display, title, weight FROM autoassignrole_page in sites\all\modules\autoassignrole\autoassignrole.module on line 39.

#2. When I go to 'Administer' -> 'User management' -> 'Auto assign role', I get this similar error:

user warning: Table 'drupal.autoassignrole_page' doesn't exist query: SELECT rid, display, path, title, description, format, weight FROM autoassignrole_page in sites\all\modules\autoassignrole\autoassignrole-admin.inc on line 80.

#3. And perhaps the most annoying error I get is when I try to enable 'Content Profile User Registration' under 'Modules'. This error appears by itself on a blank page:

Parse error: parse error in sites\all\modules\content_profile\modules\content_profile_registration.module on line 330

Any ideas? I've attached all relevant files as text docs.
Thanks for all your work on this!

jdave

riverfr0zen’s picture

hey jdave2417, please read #34 carefully. you have to follow the instructions to make it work. iant didn't report the problems you have had, so i am assuming the patch is in an ok state.

jdave2417’s picture

Category: bug » support

Okay, you were right.. had to drop the tables and make a minor edit. Now here is a new issue I'm having.

I receive these warnings after clicking "Create new account":

warning: include(./sites/all/modules/autoassignrole/autoassignrole-registration-portal.tpl.php) [function.include]: failed to open stream: No such file or directory in C:\server\htdocs\drupal-6.10\includes\theme.inc on line 1011.

warning: include(./sites/all/modules/autoassignrole/autoassignrole-registration-portal.tpl.php) [function.include]: failed to open stream: No such file or directory in C:\server\htdocs\drupal-6.10\includes\theme.inc on line 1011.

warning: include() [function.include]: Failed opening './sites/all/modules/autoassignrole/autoassignrole-registration-portal.tpl.php' for inclusion (include_path='.;C:\server\php\pear\') in C:\server\htdocs\drupal-6.10\includes\theme.inc on line 1011.

------------------------------------------------------
I am pretty sure these warnings have absolutely nothing to do with the patch itself because when I move the file "autoassignrole-registration-portal.tpl.php" to different directories I get the same warnings.

Currently, I have the file autoassignrole-registration-portal.tpl.php stored under sites/all/modules/autoassignrole. If someone has a solution please help.

jdave

riverfr0zen’s picture

Glad you got that far -- what was the minor edit you had to make, out of curiosity?

Regarding the template file error, that's strange. That file should be under sites/all/modules/autoassignrole, as you have it. And it looks like PHP is looking for the file in that same place. Can you make sure the file is readable by the process running your webserver? Otherwise, some kind of issue w/ Windows paths, perhaps? I'll take a look at it -- I may be doing something wrong in specifying the template file. If someone else is more familiar with operating under Windows, would appreciate any input.

Also realized that some of the install file items should probably be update functions -- will try to get that into the next iterations of these patches.

jdave2417’s picture

Yes, the file is readable. And I'm not sure what you're referring to about Windows paths, so that might be the cause.

Regarding the edit, don't worry about it. It was a correction I needed to make so that my code would match your code (I threw in an extra "}" that I had to take out lol).

Could this be a problem in Drupal 6.10 core?

iant’s picture

Thanks Riverfr0zen. You were right about the autoassignrole settings and the change you suggested has solved the tabs issue. I like your idea for dealing with the create content issue certainly disabling the types for the content profile types clears them from the anonymous users access. I will investigate your idea about blocks though this does seem a somewhat less than ideal solution to the issue when I compare things with role_signup behaviour in D5. However your patch is the best solution by far I have found to the use case scenario of wanting to have two types of user with differing profile information.

For info I am hosting my site on a L.A.M.P. cpanel shared hosting set up so haven't had any issues with wind0ze that others have described here.

Regards.

myextremity’s picture

Status: Needs review » Active

hello i just installed the content profile nin drupal 6.10 bu it does seem to show up in the module list.
what to do

pls help, me in a big soup right now. really urgent

Maedi’s picture

This functionality is just what I have been looking for, thanks. I would like to use this feature on a production site, how long before it's a part of the dev release?

smoothk’s picture

Hi!

Thank you so much riverfr0zen, I'm actually using your patch on a site I'm developing and all seems to be working just fine (Drupal 6.10, Content Profile and Auto Assign Role both in recent dev versions).
I'll post on issues and solutions and such as I go on.

In the next days I'll have to find a way to make RealName working with this, for instance.

I just really wish this could be part of the dev release of both AAR and Content Profile modules because it's becoming clear that it's really, really essential in some cases.

I'm also wishing to give a hand - time permitting - if anyone has unsolved issues! For istance

@myextremity
still there? Did you solve anything? Why don't you share some details about your issues?

jdave2417’s picture

Hey smoothk,

Did you get this working on a machine running Windows? If you did, I might try installing this on another windows computer. I'm still having the unsolved issue explained in my post above. Thanks.

smoothk’s picture

Hello jdave,

I'm sorry, I'm developing on a linux machine.

It looks like an error related to a wrong path, though. Have you tried importing the whole db and files to another machine?

NikLP’s picture

Content profile has recently had a fair amount of work done on it. You should rework/check these patches against the new dev version, which now has added support for fields other than cck (ie taxonomy etc) on the registration form(s).

Equ’s picture

I'm getting this error:
Fatal error: Unsupported operand types in path_to_site/sites/all/modules/content_profile/modules/content_profile_registration.module on line 179
I have latest -dev version of content_profile (without patch, because dev is later than patch), latest -dev autoassingrole with patch.

Equ’s picture

Tried to apply a patch for content_profile, but getting this error:

The text leading up to this was:
--------------------------
|Index: modules/content_profile_registration.module
|===================================================================
|--- modules/content_profile_registration.module	(revision 279)
|+++ modules/content_profile_registration.module	(working copy)
--------------------------
Patching file modules/content_profile_registration.module using Plan A...
Hunk #1 failed at 7.
Hunk #2 failed at 120.
Hunk #3 failed at 217.
Hunk #4 failed at 262.
4 out of 4 hunks failed--saving rejects to modules/content_profile_registration.module.rej
done
Daryljames’s picture

I get the same error when patching newest dev relaease

tpolyak’s picture

subscribing

mdayton’s picture

subscribing

riverfr0zen’s picture

Hey guys -- glad some of you found this to work out. Sorry about the delay -- it's been pretty busy over here lately.

When I get a chance, and if no one beats me to it (please do :) I'll rework the patch for the latest dev version.

riverfr0zen’s picture

p.s. this is going to sound really dumb why am I not receiving update emails on this thread? Aren't you supposed to be subscribed when you comment? I'm pretty sure my email address and everything else is properly set up, since I do receive updates on other threads.

OneTwoTait’s picture

Click on "recent posts" then "my recent posts" to see where there are updates to threads you posted on. I don't think it will email you.

riverfr0zen’s picture

Thanks - actually someone on IRC helped me out. You have to use the 'Subscribe to Issues' option at the bottom of the project page.

mdayton’s picture

subscribing

Equ’s picture

Hey, guys! Thanks for working on this. But any news? I'm trying to launch my new project and this is the only thing I'm waiting for...

Rosamunda’s picture

Ditto!
I need this but I really don´t like to apply patches to a working site, so, is there any chance to commit this to the stable version?
Thanks!

hlykos’s picture

subscribe

AmitV-2’s picture

Subscribing

riverfr0zen’s picture

let me know when the new cycle of development begins. otherwise i would be simply trapped, in time.

iant’s picture

@riverfr0zen,

Are your patches working in the latest dev releases for content_profile (2009-Apr-22) or autoassignrole (2009-Apr-28) ? Just finding that they don't patch OK 100% when I try to patch the latest dev sources.

unix# patch < ~/www/drupal6/riverfr0zen_20090409_content_profile_issue_313341_6.x-1.x-dev.patch 
patching file content_profile_registration.module
Hunk #1 FAILED at 7.
Hunk #2 FAILED at 120.
Hunk #3 FAILED at 217.
Hunk #4 FAILED at 262.
4 out of 4 hunks FAILED -- saving rejects to file content_profile_registration.module.rej

unix# patch < ~/www/drupal6/riverfr0zen_20090409_autoassignrole_issue_337059_6.x-1.x-dev.patch 
patching file autoassignrole-path.inc
Hunk #1 succeeded at 28 (offset 8 lines).
patching file autoassignrole.module
Hunk #3 succeeded at 396 (offset 1 line).
Hunk #4 FAILED at 413.
1 out of 5 hunks FAILED -- saving rejects to file autoassignrole.module.rej
patching file autoassignrole.install
patching file autoassignrole-registration-portal.tpl.php
patching file autoassignrole-admin.inc

see http://development.grampianlocums.org.uk/rejected_patches for details of the bits that it didn't like.

Any suggestions please ?

Thanks

NikLP’s picture

Read #49 - I doubt this has been updated.

vanquirius’s picture

Hi guys,

This is my attempt to port the patches to the most recent dev versions of autoassignrole and content_profile: autoassignrole-6.x-1.x-dev-20090512 and content_profile-6.x-1.x-dev-20090422.

I also included a patch to autoassignrole.install from node 340315, which should help with the installation of autoassignrole tables in some database setups.

Cheers

jorgedbbt’s picture

Thanks a lot for the patch, it's saved my project.
I think this funcitonality should be included in the "de facto" modules.

riverfr0zen’s picture

Confirmed that vanquirius' patches in #67 are working as expected with autoassignrole-6.x-1.x-dev-20090512 and content_profile-6.x-1.x-dev-20090422.

Awesome job man - thanks!

riverfr0zen’s picture

Status: Active » Needs review
riverfr0zen’s picture

Status: Needs review » Active

err whoops. sorry about that.

riverfr0zen’s picture

Would really like to get these into their respective modules proper, so if vaniquirius' patches have worked for you, please do speak up.

IckZ’s picture

mh.. i'm al little bit confused :D

I only need these two patches for a working solution between autoassignrole and content profile with more than 1 role? What is with these patches: http://drupal.org/node/337423#comment-1131270 ?

Can anyone bring light in the dark ?!

riverfr0zen’s picture

Hey lckZ, that thread is a little older than the patches provided here. One of the goals for the patches here was to take several stray issues/patches all relating to this same problem, and put them in one place.

Please try using just the two patches in #67 above (using fresh installs of autoassignrole-6.x-1.x-dev-20090512 and content_profile-6.x-1.x-dev-20090422). For more detailed instructions on setting it up, you can look at #34 above (an older version of the patches in #67). Good luck!

IckZ’s picture

Hey riverfr0zen,

great job, I think these patches work like a charm but I have one problem:

- With these permissions (edit xxx-content-type) every guest see the link "create content" in the navigation menu. Is this neccessary?

Is it possible to set the url on the registration portal to somthing clean? user/register/role?destination=user%2Fregister to user/register/registrationportal?

riverfr0zen’s picture

@lckZ: For your first issue, try to see if the solution in #37 works for you.

As for your 2nd issue, can you do me a favor and take a look at your {autoassignrole_page} table, and let me know if there are entries in it and what they are? There should be a row corresponding to each of the roles you are setting up for content profile.

For issue 3, I'm not so clear what you mean. Are you saying the register page appears when you do this (when you disable from autoassignrole), with options to register for the different roles?

jorgedbbt’s picture

Just confirming that vanquirius' patches in #67 are working as expected.

NikLP’s picture

Are these patches made against the latest dev version? If not, they need to be updated.

IckZ’s picture

Hi riverfr0zen,
I solved my problems yesterday night on my own and edited the post because I didn't saw your answer. Sorry for that. Everything is running fine now. Thanks for that job!

riverfr0zen’s picture

@lckZ: glad it's working out -- actually vanquirius did those latest patches, not me

@NikLP: Please refer to the versions indicated in #67 -- as of this time, these patches are against the latest dev version.

IckZ’s picture

Hi riverfr0zen,

is there any possibilty to set the path to register manual? I mean to switch from:

user/register/content_type to what/ever/you/want :).

edit//

Hm.. when you delete following lines from content profile registration profile:

//if (!user_access(strtolower("create $type content"))) { // if user don't have permission to add current content type, don't show the content type form
//continue;
//}

guests don't need the permission to create "content type profile". Are these lines nesesary? I don't think so because guests would be so or so have all rigths to create every profile content... So you dont have troubleshoots with the hiding of the menue "create content"

Equ’s picture

Thanks for patches, but unfotunately my fields do not appear on registration page... I tried using suggestion in comment #34 about putting fields in field groups, but it didn't help me :-(

iant’s picture

@riverfr0zen

they work for me fine.

Thanks guys

riverfr0zen’s picture

@IckZ: Not for this version. But you can try to use an alias or mod rewrite to achieve that.

@Equ: Can you tell us a little more about your set up? What OS are you running, how you have configured your roles, etc ?

riverfr0zen’s picture

@IckZ: Re: your second question about the permissions, I think that is something the module developers will have to decide.

Equ’s picture

Hi, riverfr0zen!

Sorry for the late reply. I'm running Unix (Apache/1.3.37, PHP/5.2.9).

I have two content types (Type 1, Type 2) and two roles (Role 1, Role 2). Anonymous user has rights to create both Type 1 and Type 2. Content permissions module is disabled.

In Autoassignrole configuration page (admin/user/autoassignrole) in "Assign from path" section:
Registration Page As Portal - Enabled
Both roles are enabled with display method "Pages with no navigation"
Paths - user/register/role1 and user/register/role2

Content profile:

- "Use this content type as a content profile for users" is checked for both types
- Every content type has its own path for registration

Content profile tab (in the edit content type page):
In User registration section both "Use on Registration" and "Use URL argument to select this content type on registration." are checked for both types.

riverfr0zen’s picture

Thanks for the details Equ. Firstly, in the Autoassignrole, the paths should correspond to the machine readable content-type name, e.g:
user/register/type1 and user/register/type2

What is the exact nature of your problem - are you seeing the landing page (registration portal page) with links to register for different roles? Is the problem only after you click through to a particular role?

riverfr0zen’s picture

Status: Active » Needs review
Equ’s picture

riverfr0zen,
The problem was solved by clean install of all modules with patches and changing my paths as you suggested in #87 ("the paths should correspond to the machine readable content-type name").

Thank you very much and hope to see this in official releases soon :-)

riverfr0zen’s picture

Status: Needs review » Reviewed & tested by the community

Not really sure if I'm supposed to change to this status, but it appears that a number of people have tested these patches (#67 above) successfully. For devs, you can find more complete details/instructions in #34 above. Would be great to have these in the modules proper.

fago’s picture

Category: support » task
Status: Reviewed & tested by the community » Needs work

* Either this patch has to become much simpler or we need to move into another sub-module. To ease maintenance modules have to stay simple and easy to follow. Apart from that, most people won't need that complexity so they shouldn't be confrontated with it.

* There is now content_profile_registration_add_profile_form(), which should be easy to re-use. (Perhaps it needs some small adaptions though).

* So if AAR provides further registration paths, it can provide a select on the CPR form for choosing registering for it and then rely on content_profile_registration_add_profile_form() to add the form. I don't think we need another option to set a "default CP".

riverfr0zen’s picture

Ok, it would have been useful for patch developers to hear about this new method in this thread when the last dev release came out :) Also, considering this seems to be by far the most replied to issue for this module, I'm not sure that most people won't need this complexity. In fact, if you think about it, most people would want to use this module in leveraging CCK to create multiple profile types.

In any case, using content_profile_registration_add_profile_form() should (in theory) allow us to leave content_profile alone, and have aar handle this use case -- if/when I have time, I'll look to doing that (seems like it should be pretty easy), but if someone wants to beat me at it, please go ahead! :)

NikLP’s picture

I *did* tell you fago was working on that for me, dude! Plus, I'm paying him for it, so please listen... :p

He should also be looking to get aar working properly as well.

riverfr0zen’s picture

Ha ha, yeah, yesterday, which isn't very useful ;) And you didn't really say anything that was useful to a developer. :P

Anyway, like I said above, shouldn't be too much hassle to get aar to handle this now (esp. w/ the aar patch above). I'm working on a larger project where this issue is only a small component, so for the moment this patch works ok for me. When I have time later, I'll come back to do it the better way (if it hasn't already been done). The changes that will need to occur shouldn't really mess any existing data up anyway.

NikLP’s picture

Erm, see #78 and #49...

riverfr0zen’s picture

we can fall into a recursion here, which i will now avoid. anyway, if/when anyone does add this to aar, please drop a line on this thread too! i will if i do.

fago’s picture

I've just improved content profile registration a bit, so modules can alter the node types used on a settings page.

-> See commit: http://drupal.org/cvs?commit=218916

-> AAR can rely on that now.

fago’s picture

For an AAR patch using this stuff see #477910: fix / simplify content profile integration - let's set this issue to fixed once both patches are in.

riverfr0zen’s picture

cool stuff, thanks.

iant’s picture

Thanks for the update fago; unfortunately when I try them I can't seem to get them to work to give me the option of the user choosing their role when they go to create a new account like they did with Riverfr0zens patches on the previous dev version. I've grabbed the latest version of content profile and the latest version of ARR and applied the patch you give in #477910: fix / simplify content profile integration. But I don't get the screen to choose which role I want despite this all being set up as has been suggested to do this; have I missed something ? Do I need to empty the database for these 2 modules and start a fresh ?

At least I have stopped getting the error I was having before - http://drupal.org/node/308301#comment-1618652 where I was trying to use one content profile type for generic fields and then the 2 role specific types for the roles specific stuff.

Any suggestions people please ?

IanT

fago’s picture

>But I don't get the screen to choose which role I want despite this all being set up as has been suggested to do this

I've not implemented such a screen, those patch just fixes the AAR feature to allow selecting appearing profiles per registration path. Though I think AAR can provide such a screen.

NikLP’s picture

The screen was, I think, part of the original road map of AAR, but that's something that Cyberswat was going to implement, AFAIK.

iant’s picture

Might try and have a look at Riverfr0zens patch to try and work out which bit implements this screen and create a patch for ARR to use that bit (unless someone beats me to it). But will have to wait a few days as my real job is a bit busy just now.

Thanks

Ian

NikLP’s picture

The latest stuff I've had from fago is basically feature complete. I can't comment on the "choose my role" thing yet, but if anyone fancies slinging me a few bucks, please contact me privately via my contact form. I've paid for this recent development out of my own pocket and it won't work out to be cheap.

gmclelland’s picture

I tested @fago's patch with latest dev releases of content_profile and autoassignrole. I specifically tested to check and see if the user profile nodes where getting created automatically for all available profile node types. I'm happy to say that just the Profile node type was created.

It looks like @cyberswat has some changes coming as well to fix "choose your role" selection on the registration page.

iant’s picture

The "choose your role" feature is part of ARR, but is currently broken. cyberswat has moved the issue to #482450: Repair user selectable roles. On that basis I'm happy to say that changes here and at #477910: fix / simplify content profile integration work fine for me as the "choose your role" feature is a separate but related issue.

I suspect that means that things are sorted here; can this be updated to reviewed and tested now?

Thanks to NikLP for sponsoring fago's work on this and to fago, riverfr0zen and others for solving this.

iant

svyat’s picture

I am still having the same old issue with the latest CVS dev versions of AAR and CP/CPR installed. On the registration page all the fields from all CP content types are displayed. The paths set up under "Assign from Path" in AAR seem to have no effect. After the registration, a new node of each CP content type is created.

Could someone post their exact settings for AAR? Does setting the AAR "Assign from Path" to user/register/[cp_content_type] still apply? Is this the only setting that is needed to integrate AAR with CPR?

Thanks!

NikLP’s picture

Try it with a path that doesn't being /user/register - current menu behaviour for a path like /this/is/real/BUT/THIS/ISN'T is that the path /this/is/real will be called. It's likely that /user/register/[type] is just calling /user/register.

Replace the paths in the AAR (or has it moved now?!) with something like /register/type1 and /register/type2 and see how you get on with that.

It all works for me so far.

svyat’s picture

Thanks NikLP, I've sorted it.

Now it would be perfect if CP allowed similar integration for the admin user create page as well :)

NikLP’s picture

Oh doesn't that work? I've not tested it yet. I need that for my next project, annoyingly. That's quite soon too...

@fago, do you have any thoughts on that?

gmclelland’s picture

It looks like the ability to select roles on sign up is working in the June 5th Dev version with the Dev version of Content Profile.

fago’s picture

Component: User registration module » Documentation
Status: Needs work » Active

#313341 got committed, so this is issue is fixed. Let's mention it in the readme.

fago’s picture

Status: Active » Fixed

I've done so -> fixed.

Status: Fixed » Closed (fixed)

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

ecstasy2’s picture

I have tried everything to patch the last version of autoassignrole without success. I would appreciate if someone send me a patched module pliz.

paganwinter’s picture

Not too relevant here, but, with the above approach of using autoassignroles, is it a better idea to use different content types for each role, or use a common one, but by restricting access to individual fields of the content type to users of specific roles?

ExTexan’s picture

Ok, so I applied the patch to AAR referenced in #106, and *tried* to apply the patch to Content Profile referenced in #67, but it didn't work. I went in to do it manually, but the code in the patch file doesn't match the .module file at all. By that, I mean the code that is supposed to remain unchanged (the code before and after the added/subtracted lines).

I really need to have different content profiles for different types of users. Can someone tell me which versiona of Content Profile and AAR I need and which patches I should apply (if any)?

pmathur01’s picture

Hi, I have 2 kinds of users for my site. The first user can only bookmark the content while the second user on signup is charged for subscription for posting content. Further the Charged subscriber can have multiple payment plans to choose from. How do I go about this..
thanks in advance. I am just lost...( I created 2 profiles through content profile)

pmathur01’s picture

Status: Closed (fixed) » Active
kenorb’s picture

Issue summary: View changes
Status: Active » Fixed

Status: Fixed » Closed (fixed)

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