Integrate Auto Assign Role - like Role Signup

c2uk - February 3, 2008 - 16:19
Project:Node Profile
Version:5.x-1.4
Component:Code
Category:feature request
Priority:normal
Assigned:Vuds
Status:needs review
Description

As from the Role Signup project page:

This project has been deprecated ... it's core functionality now exists in the development snapshot of the autoassignrole module http://drupal.org/project/autoassignrole and can be found at http://ftp.drupal.org/files/projects/autoassignrole-5.x-1.x-dev.tar.gz ... it is a complete rewrite, any testing of the new code against the issues for this project would be greatly appreciated.

Any chance of integrating a similar functionality when Auto Assign Role is in use, and not Role Signup? Auto Assign seems to work slightly different than Role Signup and I've had a look at the relevant code in the Node Profile module that integrates Role Signup - but this is a little bit above my php skills.

#1

fago - February 4, 2008 - 11:24

hm, as I'm not interested in this feature, I won't. But if someone steps in and provides a clean patch, I'd be happy to commit.

#2

lauscherli - March 19, 2008 - 21:50

hm, just got to the same point as c2uk. the combination would also be nice for me, because different roles = different content-type-access-control, finegrinded views by roles, badges by roles...
because of a lack of coding-skills i cannot be more than a cheer-leader for this issue...

anyway: thanx for the the great module!

#3

civicpixel - May 8, 2008 - 18:08

I'm very interested in this as well as I have several projects already using Role Signup that will need the same functionality when they move to D6. I'll try to work in time for a patch if someone doesn't get to it before me.

#4

fago - June 16, 2008 - 13:34

marked http://drupal.org/node/270764 as duplicate

#5

fago - June 16, 2008 - 13:34
Version:5.x-1.3» 5.x-1.x-dev

#6

Richard_ - June 20, 2008 - 21:42

I vote for this feature too. I am using role signup with nodeprofile to have multiple profile types according the role.
I take it as biggest advantage of nodeprofile (along with other cool features :)

#7

Vuds - July 8, 2008 - 22:12
Version:5.x-1.x-dev» 5.x-1.4

Hi guys,

As Fago had written above, I tried to write some modifications and now I'm proud to present to you the patch. As I tested it, it appears to be working very well (for 1.4 version).

Some features:

* Auto assigning role for a new user just shows the profiles for that role (yes, the profileS, not only one anymore) but you can also have him/her choosing new roles;
* User Role Assigning is "almost" perfect. From the user choosing his/her role, until after registration, editing profiles and so on, the user only sees and only has links to the permitted profiles. I took off all inside profile links, tab links or whatever from the profiles not associated from that role. The only way that a user could create a non-desirable profile is at link menu "create content" (but it appears that someone had been working on that - http://drupal.org/node/275403 ) and if his/her role is permitting to create it, but this profile would not never more be linked directly with the user account.
* Replaced all messages that were pointing to old Role Signup module, and also putted some extra infos if the Auto Assign Role is not configured properly.

If you find any bugs, relate here so I can try to help! Also, don't forget to apply the patch for AAR because of wrong sorting ( http://drupal.org/node/235707 - it tooks me a lot of time trying to discover what was wrong)!!!

Thanks for attention! Gook luck!

AttachmentSize
nodeprofile_autoassignrole-compat-v1.patch 8.35 KB

#8

Vuds - July 8, 2008 - 22:13
Status:active» needs review

#9

rentex - July 11, 2008 - 17:35

Subscribing.

#10

fago - July 30, 2008 - 10:10
Status:needs review» needs work

thanks. the code looks quite good, but I've not tested it.

But please make sure the code follow the drupal coding style, in particular the comments need work. (It's well commented though!)
and it's "foreach (" instead of foreach(

Furthermore it'd be great if someone else could give this a test before we add it.

#11

ordex - July 30, 2008 - 16:28
Category:feature request» bug report
Status:needs work» active

This is my first post, so i could have some problem in setting comment header :P
Anyway i got a problem: in nodeprofile tab, when i select the allowed roles to see the content during registration, this setting won't be saved.
After saving all, everyroles appear unselected.

#12

Vuds - July 30, 2008 - 22:49
Category:bug report» feature request
Assigned to:Anonymous» Vuds
Status:active» needs work

@fago: Thanks for the comments! Is there any place where is related the Drupal coding standards? I tried to look for a bit but I couldn't find. It'd be a pleasure to leave the patch standardized.

@ordex: Is this problem related with the Auto Assign Role module and the patch I've published here? If yes, can you give more detailed information (try to explain all steps of what are you doing)? If not, please open a new issue at http://drupal.org/project/issues/nodeprofile, with the link "Create" under the title "Issues for Node Profile".

#13

Vuds - July 30, 2008 - 23:39
Status:needs work» needs review

Ok, I've found the standards. here you go the patch reworked.

Also, I reinforce the desire to have more people testing it. There is already some time that I've worked on this, and since then I've not yet used for production neither had tested more while I'm developing other parts of my site.

AttachmentSize
nodeprofile_autoassignrole-compat-v2.patch 8.27 KB

#14

ordex - July 31, 2008 - 08:35

I didn't apply the patch presents here http://drupal.org/node/235707.
Now everything is working!

#15

fago - July 31, 2008 - 10:29

hm, this lets me think whether it's a good idea to integrate with a module that doesn't seem to be maintained very well?

A rather critical fix is left uncommitted, while there were no commits since february. hm, is there no better alternative?
of course rolesignup isn't either.

#16

Vuds - August 5, 2008 - 02:19

Fago, I understand your position. Possibly the other module is not very well maintained (you stated there, and there is a announce looking for co-mainteiners).

Nevertheless, it's the only module at the moment that does this job (and I had looked for this feature for weeks), and the patch there is mandatory but it's the only one needed to get the module working.

I think it's your choice, to include the code in the Node Profile module, or to leave it as an alternative patch.

Just to let you know that I'd be happy to try to help others with this mod in both ways.

Thanks for attention!

#17

fago - August 5, 2008 - 08:59

I thought about it and I'd include it - as it's still an improvement to the current rolesignup integration module. So this needs review.. :)

#18

Michelle - September 3, 2008 - 20:06
Status:needs review» needs work

I need this for a client, so I'm giving it a whirl. I've run into two problems:

1) When I applied the patch, the very end got left off. Might have just been a glitch.

2) I'm not quite sure how this is supposed to work. I have 3 profile node types, one for each role. I have auto assign role set up. I have nodeprofile set, with this patch, to only show the right node type to the right role. But, on the registration page, the user doesn't have a role until they select one. What I'm ending up with is all three profiles on there with the auto assign role radio box at the bottom of the page.

To be honest, I'm not clear on the workflow here. It seems you would have to have a two step process where the user first selects the role and then is presented with the profile. What am I missing?

Edit: I had a look at workflow-ng but there doesn't seem to be any way to set it up to redirect them to edit whichever nodeprofile node type they have access to.

Michelle

#19

Vuds - September 4, 2008 - 20:57
Status:needs work» needs review

Hi Michelle,

1) I had reviewed the patch and it had some kind of lines allocation problem. Now with this version attached it should work ok.

2) Okay, this patch is good for a simple choice of roles (as the Auto Assign Role stands for by nature), since it does the assign to the new user automatically. But it's clear that while this is a new user, he/she doesn't have a role and neither a profile yet, right? So this would be really a two-step "registration". I also came with this problem for my case, and I've got a tricky solution to make it appear more "integrated":

1) I think that you have fields in the three profiles that are common, right (like name, address, telephone, etc.)? Maybe some of them are mandatory to have information. So I did a unique form for this data, and with Bio module I had choosed it as the "Content Type for User Biographies". Also in this Bio setup page I have this options:

Display Bio Link: None
Use Bio for User Profiles: None
Takeover Profile: None
Show Fields on Registration Form: Enabled
Registration Form Fields: As you wish (just remembering that if you had marked the field in the form as mandatory, it will appear already marked here too)

All of these to make these fields appearing in the new user registration moment! But you still need integration with Node Profile to make it better. So for this content type yet you have to set it as a "Use this content type as a nodeprofile for users" in the Content Type -> Edit tab setting, and yet as a "Integrate this node profile with user categories", with all your three roles assigned to this form in the "Node Profile" tab.

2) Now you have one Bio Profile with mandatory data that is also a Node Profile, and left 3 different profiles with three different kinds of data for Node Profile to work. These ones need to be assigned each one to each role (as you already did) as a Node Profile also.

3) This thing already works "almost" as we wish. I also had managed to each role just be permitted to create/edit your own node profile and the three permitted to create/edit the main bio/node profile (but not delete as usual). Limited to create just one node per user of each when necessary (but you can use it as for your choice). Also created templates in the themes to "drupal_goto" users trying to see any of these nodes types (4 content types in your case) to see user profiles instead.

4) And I had integrated all of it to show off with your Advanced Profile Module :)

Resuming the responsibilities:
Bio Module: Mandatory common fields in the registration (one initial node);
Node Profile: Integration for editing (as for each tab as a node) and Auto Assign Role (one initial node + 3 nodes for each role);
Advanced Profile: Integration for viewing (all of 4 nodes as panels - your choice of field, fieldgroup, whatever).

It works very well, since you don't activate the takeover-profile and use as user profile parts from Bio Module (they conflict with Node Profile badly) .

And I also understand that it is still missing some part of it here (the workflow from registration to the right node profile assigned to the user role). I was thinking to see it with workflow-ng, good thing to know that it doesn't work. But as a workaround, with your module, as soon as the user comes to see his/her profile and he/she notes it is lacking of data (I had managed to Panels show a message when entering in the profile not totally filled), he/she will become instigated to complete it to the system doesn't show the message anymore.

Well, this is a long relate, hope it helps you. Any doubts, write it here...

Best regards!

AttachmentSize
nodeprofile_autoassignrole-compat-v3.patch 8.27 KB

#20

Michelle - September 4, 2008 - 21:12

Ah, I think I see part of the problem. If I'm reading this right, this patch doesn't work when you have AAR configured to let the user choose the role.

I don't want to bring bio into the equation. Using both of them on a site is redundant. Ok, it seems that I'm not just missing something with this patch; it isn't meant to do what I want. It is still useful, though, once we're past the registration page, in tying the profile node to the role. So +1 for that.

As for the actual registration process, I'm going to look closer at workflow and see if I can write a custom rule for it that will take the user to the next step. Fago, any thoughts on that?

Thanks,

Michelle

#21

Vuds - September 4, 2008 - 21:15

Thinking more about what Michelle wrote, I understood that you were hoping that Node Profile + this patch + Auto Assign Role would load the form or redirect it in some way in the registration time, is that right?

Maybe it could possibly be done, but then Node Profile needs to have a feature like Bio does (show fields in the registration form). With that I could kick off Bio from my solution above, for example. But I think that it is more complicated to make it then what Bio offers, since it treats only one content type, and Node Profile may treat as many as the admin wish.

Or have some kind of redirect after registration, but again a problem, we have to remember that Node Profile does not create a content type by itself (like Bio also does with its user profile).

Well, maybe Fago can help with ideas also.

#22

Vuds - September 4, 2008 - 21:32

Ah, I think I see part of the problem. If I'm reading this right, this patch doesn't work when you have AAR configured to let the user choose the role.

For me it's absolutely the opposite! With that solution, my workflow actually is:

user goes to the website -> user goes to registration -> user fill the login, password, etc. choose his/her role, complete the mandatory bio fields -> user does login in the site -> user (may) continues filling in the bio or node profile form associated with its role OR (may) navigate through the rest of site (in the truth, from this step, it's the users' choice to do what he/she wants).

#23

Michelle - September 4, 2008 - 22:11

Ah, I see. I guess that would work but then you have that extra bio node hanging out there and that really is redundant to have two modules that do the same thing. I'll just keep working with workflow. I think that's the answer for me.

Thanks,

Michelle

#24

Vuds - September 4, 2008 - 23:15

Ah, I see. I guess that would work but then you have that extra bio node hanging out there and that really is redundant to have two modules that do the same thing. I'll just keep working with workflow. I think that's the answer for me.

Not that too. When I set

Display Bio Link: None
Use Bio for User Profiles: None
Takeover Profile: None

It takes off the Bio link and tab. Then just Node Profile manipulates the nodes, and I have just one clean line of tabs when editing the user info.

#25

fago - September 22, 2008 - 14:33

sry for the late response, I was on vacation.

with role signup it worked that way:

A: User has too choose the role to register for
B: The user is redirected to user/register/roleXY which has a registration form for the roleXY, which included any activated nodeprofiles for this role
C: the user registers by filling out the information

I don't see what's different when one uses bio registration integration vs nodeprofile's registration integration.

@patch: When it doesn't do that, what does it else?

#26

Vuds - September 29, 2008 - 19:33

@fago: The main "plus" of bio registration is to put any field you want (and the required fields go automatically) from the bio node in the right moment of registration (that means, it's incorporated in the registration form, only for registration).

Are you sure that Role Signup Module used to do that way? When I tested it (even deprecated), it didn't done a "workflow" between node profiles before the registration went complete (that means, the anonymous user sends the registration form). Neither does Auto Assign Role, and the patch doesn't have how to do anything with that.

#27

fago - September 29, 2008 - 20:49

Nodeprofile does it that way - and it has integration for rolesignup which allows to do it role based (different profile per role). Any integration for autoassignrole should do this too.

#28

Vuds - October 9, 2008 - 17:53

Hmmmmm, now I saw that works like that (since I'm finally beta testing my site with a few users), and it is also getting me a problem (but I'll open it at Panels)...

First, the answer to #27: You mean "redirected" with, after register (without e-mail confirmation), the new user is taken to the node profile to complete his information. Ok, that's true, but what I was thinking about (and I thought that Michelle too) is, *before* confirming registration (with e-mail confirmation or admin approval processes), the new user should be able to complete a node profile right to his role, and in her case (well, I think it's case for everyone who uses auto assign role/role signup), she didn't wanted to put information from 2 different node profiles that are for 2 different roles in the registration form (since the new user should opt for one or another role).

Then, the solution would be: when this new user chooses the role, the system could:

- "Reload" the page automatically (or start a JS trigger for hidden fields, perhaps) and show the fields of the right node profile for filling right after he had chosen his option of role;

- Or after submit, be redirected to the right node profile equivalent with the role assigned;

- BUT, these two options should occur before the complete registration ending (because of those e-mail confirmation/approval processes). That means, the new user (until now anonymous) should be able to complete all filling (right node profile included), and just after confirmation he would be able to access the system.

#29

gauravkumar87 - October 15, 2008 - 12:10

subscribing......

#30

Prodigy - November 6, 2008 - 03:50

subscribe

#31

Summit - November 20, 2008 - 22:51

Subscribing, greetings, Martijn

#32

ergelo - January 18, 2009 - 05:11

subscribing

#33

freatida - February 26, 2009 - 09:04

I'm looking to do the same thing as Michelle if I've understood right:
User goes to register > chooses role > fills in profile information specific to that role > submits registration
Did you get it to work with workflow Michelle?

#34

Michelle - February 26, 2009 - 16:16

@freatida: Sorry, that was months ago and I don't really remember what we ended up doing.

Michelle

#35

momper - June 25, 2009 - 15:02

subscribing

#36

cyberswat - August 25, 2009 - 13:08

@freatida in comment #33 #331409: Pages with no navigation - how to implement? Implements the ability to do this

 
 

Drupal is a registered trademark of Dries Buytaert.