I needed this to work with the Role Assign module. I found this ticket which mentions Role Assign integration which said to start a new ticket if someone was interested in this.

It appears that the only thing that needs to be adjusted to work with the Role Assign module is the JavaScript, so that it attaches the Role Expire fields to the Role Assign versions of the Role fields. I will attach a patch shortly.

Comments

kpaxman’s picture

StatusFileSize
new1.09 KB

Patch attached.

pokermoneyclips’s picture

I believe the initial call of

$(document).ready(function() {

should be a Drupal.behaviors call per https://drupal.org/node/304258

applying patch at
Hunk #1 failed at 10
Hunk #2 failed at 24

against the latest dev build (2013-Oct-01)

liam morland’s picture

Issue summary: View changes
StatusFileSize
new1.41 KB

Reroll.

liam morland’s picture

We at University of Waterloo have been running this patch successfully for several years. Patch #3 applies cleanly as-of today.

kpaxman’s picture

BTW, it looks like at some point the "document ready" got replaced with Drupal behaviours upstream. (And at any rate, it was not introduced with this patch.)

rcodina’s picture

Have you tested the patch with latest dev from 9 Jan 2018?

liam morland’s picture

The patch applies. It hasn't been deployed to production yet.

liam morland’s picture

The patch continues to apply cleanly on 7.x-1.0-rc3.

sgdev’s picture

Status: Needs review » Needs work

We need to coordinate on this. It conflicts with what Role Delegation needs: https://www.drupal.org/project/role_expire/issues/1899606#comment-12727001

Role Delegation relies on #edit_roles_change while Role Assign uses #edit_roleassign

Role Delegation is about 3x more popular than Role Assign, so we need to support both.

sgdev’s picture

Status: Needs work » Closed (duplicate)
Related issues: +#1899606: Support role assignment modules

I think I have an easy way to incorporate this. Take a look at the new patch I've created: https://www.drupal.org/project/role_expire/issues/1899606#comment-12727684

I believe all that is necessary to incorporate your patch is an extra else specifically for #edit-roleassign-roles. Everything else matches with the previous changes made for Role Delegation.

I don't have the Role Assign module installed, but please test and tell me if there are any problems, especially with the checkboxes. Thanks.

liam morland’s picture

Are you saying this new patch should work as-is or that an extra else still needs to be added?

sgdev’s picture

I'm saying the patch in #3 is incorporated into the newest patch for #1899606. No need for it.

From a clean version of Role Expire, apply the patch in #1899606 and it should work for Role Assign. If it doesn't, let me know.

kpaxman’s picture

Role expiries now show up with Role Expire and Role Assign enabled - however, they all show up at the beginning, separate from the roles themselves; additionally, all roles appear and are therefore can be set to expire, not just the ones the user has access to through Role Assign. I'm fiddling now to see if I can modify my patch from this queue.

kpaxman’s picture

I now have a patch but it turns out it's more related to the ticket that this is closed as a duplicate of. (https://www.drupal.org/project/role_expire/issues/1899606)