Hi

I would like to use this module on Drupal 6.x - what are Your plans for Drupal 6.x ?

Thanks
Bo

Comments

andypost’s picture

Component: Miscellaneous » Code
Status: Active » Needs review
StatusFileSize
new14.53 KB
new14.68 KB

Commutative patches against latest cvs-source.

- Included http://drupal.org/node/235707 patch about sorting.
- Code formatting and cleanup.
- Default values provided as defines.

Second patch for migration to 6.x

Waiting for reviews.

Nick Fedchik’s picture

I apply the autoassignrole5-dev.txt patch on "5.x-1.1" version (of course, rasping the patch, because of src code formatting differences).
Looks like the bug (Roles are not assigned after registration) has been fixed.
Waiting for new version.
Thanks for andypost.

mariusooms’s picture

Hi...I tried to apply this patch, but it completely choked on it (It could well be me, I'm completely green at patching). What does rasping the batch mean? In the end I just went in and changed the code manually. I can also verify the auto assign now works!

Kind regards,
Marius

Nick Fedchik’s picture

StatusFileSize
new12 KB

That's mean than I hack the patch file - cut off the unnecessary differences for .info and .install files
Here is my patch attached.
You can copy the patch file into the module directory, than apply as listed below:
$ patch -p0 < autoassignrole-5.x-1.1-dev.patch

mariusooms’s picture

Thanks Nick...I'm learning as go. It makes sense now looking at the two different files.

meeotch’s picture

Just applied this patch against 5.x-1.1... unfortunately, the User-Selected roles are not being assigned on first login. I'm using logintoboggan, so I assume it's the same compatibility issue that's been around for a while. (Though I thought this cumulative patch was supposed to fix it.) Does anyone have further info on this problem, or an idea of how to track down why the initial login is not triggering role assignment?

EDIT: definitely a compatibility issue. When logintoboggan is disabled, roles get assigned correctly. It seems that this has been mentioned in several threads - some of which have been pointed at this thread as a fix, or marked "closed." Should I submit this as a new issue? (Doesn't feel like it belongs here, other than this is where the patch came from...)

nina_bee’s picture

This is great! I'm new to drupal and I really needed this to work. Now I'ts perfect! Roles are assigned by the user himself. Beside I "patched" for the fiste time!!! Thanks a lot
*********^_^****
Bee

Nick Urban’s picture

StatusFileSize
new15.21 KB

Hey Andy,

I improved your patched version to remove some errors that were appearing in the Drupal 6 version.

Applying this patch against HEAD produces (as far as I can tell) a fully functional D6 port.

There were two notable issues: The first is a small one, which is that you were using DEFINE'd #default_values for the '#type' => 'checkboxes' form elements, which didn't work, because default values for checkboxes has to be an array. This was causing errors until the module was configured. I replaced them with a default empty array (can't DEFINE to an array, apparently, or I would have done that).

Secondly, and more importantly, the roles set in hook_user were being cleared by user_save, which replaced them with the roles in the $edit['roles'] array. I changed the code so instead of inserting manually it just adds the roles (as keys, mind you, to keep with users_roles() format) to $edit['roles'] and now it seems to work fine. Another option would have been to unset $edit['roles'], but since the feature is already there, why not use it?

Nick

nina_bee’s picture

Hi! Iv applied the autoassignrole-5.x-1.1-dev.patch patch and since then only users with admin access can access my forms (created with webform) I tried to desable and uninstal both modules and then reupload and reenable webform but the problem remains. Is there a way to fix my website? or shoul I restart from scratch?
Thanks
Bee

neruda001’s picture

Version: » 5.x-1.1
Category: feature » task

andypost thank you for your advice. It works great! I've used autoassignrole5-dev.txt to modify autoassignrole.module and autoassignrole.install and even if I had not unistalled and re-installed the module, it works only with modifications !

thanks a lot

Pablo

neruda001’s picture

Assigned: Unassigned » neruda001
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new2.01 KB

I'm posting the autoassignrole.module 5.x-1.1 patched as autoassignrole5-dev.txt file posted by andypost.

I apologize if I've used not right tag to classificate the file.

rename it to autoassignrole.module

and don't forget to modify autoassignrole.install file as described in autoassignrole5-dev.txt file, if you have to install it i suppose.

Pablo

giorgosk’s picture

This works but with logintoboggan enabled it does not
(as meeotch mentions)

giorgosk’s picture

Title: Please upgrade to Drupal 6.x :-) » Autoassignrole not assigning role on registration

I think this title would be more informative

meeotch’s picture

@GiorgosK (and everyone else) - Note that there's another issue that is already addressing the Autoassignrole / LoginToboggan incompatibility:

http://drupal.org/node/226765

Anyone who wants to chime in on that thread with ideas should definitely do that.

zmove’s picture

Subscribing for a drupal 6 version without applying patch

Nick Urban’s picture

StatusFileSize
new2.06 KB

For zmove and whoever else:

If you want to use my modified Drupal 6 autoassignrole without patching, you can download it here.

(I also made a few formatting changes to adhere more to Drupal standards--hopefully no one will mind :)

scotese’s picture

Thanks for creating this but when I load this I still get a message saying this is a 5.1 version and not compatible with drupal 6.

mariusooms’s picture

StatusFileSize
new10.04 KB

The .info file and .install file are missing. I included them here for you, but they are not official. Maybe the maintainer can finalize this and get it branched to a 6 release.

Regards,

Marius

Lieb_’s picture

this last zip file works as far as i am able to tell thanks a million, none of the other modules are ported to 6 yet.

cyberswat’s picture

Status: Reviewed & tested by the community » Closed (fixed)

I rewrote the module and created a 6 dev release. Got rid of the memory intensive variables and used the new options in hook_user to do this module properly. Will not commit these changes but feel free to evaluate the new module.