Using this module, the changes are not saved. For some reason when the form is submitted the roleassign.admin.inc file is not included so the hook_user_presave() is never called.

This can be fixed by adding the following to _roleassign_form_alter():

$form_state['build_info']['files']['roleassign'] = drupal_get_path('module', 'roleassign') . '/roleassign.admin.inc';

Comments

salvis’s picture

Sorry, this issue somehow slipped through the cracks.

What is the path (URL) where your changes are not saved?

salvis’s picture

Status: Active » Closed (cannot reproduce)

No follow-up.

seanB’s picture

Status: Closed (cannot reproduce) » Active

I was able to reproduce this. The hook roleassign_user_presave() in roleassign.admin.inc is not called when saving a user.

Moving this function to the roleassign.module file works. You need to move the functions _roleassign_assignable_roles() and _roleassign_sticky_roles() as well.

I can't tell why the choice was made to add the hook_user_presave() in the admin.inc file, so maybe there is another fix for this issue that doesn't involve moving the functions.

salvis’s picture

Status: Active » Fixed

Thanks. I've taken the easy way out and created a thunk in roleassign.module.

Pushed to the -dev version (give it up to 12h to be repackaged).

Please try it out and let us know how it works.

GaëlG’s picture

It works for me. For those who don't want to use the dev version: http://drupalcode.org/project/roleassign.git/commitdiff/0429689

salvis’s picture

Thank you for your feedback, GaëlG.

Status: Fixed » Closed (fixed)

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