The module works fine with User id 1 the admin user of the website. But for other users with administer user permission and all other needed permission does not integrate with the role delegation module.

The form field to input the date/time of expiry is there but does not appear when the check box is checked for each user role. I've attached a screen-shot for convenience.

check attachment, I think its a form alter and JavaScript bug. How can it be solved?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

stewsnooze’s picture

Can you reproduce this using Garland? I just want to remove the theme from the equation before I start debugging.

stewsnooze’s picture

Status: Active » Postponed (maintainer needs more info)
geshan’s picture

Status: Postponed (maintainer needs more info) » Needs work
FileSize
18.3 KB
25.51 KB

sorry for replying late:

It does not work in garland either. Another problem I figured out is it works in edit not in user add for Admins/uid 1.

The div id is different when it comes from the role delegation module.

I'm using the newswire theme, if it can make it easier for you.

Hope for some help, thanks.

teliseo’s picture

Status: Needs work » Needs review
FileSize
6.85 KB

Attached is a patch to make Role Expire integrate with Role Delegation, and may also fix other bugs:

  • Integrates with Role Delegation by using the roles_assign checkboxes field in addition to the roles field that the user module (part of core) creates. There is a bug in Role Delegation, #797452: Roles are not shown at their usual location, that needs my patch (or future module version with it integrated) for this to work. (It might seem that it would be better if Role Delegation just created checkboxes called roles instead, but this would trigger a safeguard in core against attack.)
  • I’ve added the appropriate CSS class attributes to the register form (/admin/user/user/create) so that the JavaScript can attach the expiry dates to the role checkboxes. This may be related to #647866: Expire textfields do not display on admin create user, which was claimed to be fixed, but I saw the same problem as the OP.
  • Because a form listing delegated roles may not be a complete set, I’ve made sure that expiry date fields for non-listed roles are not in the form, and that form submission does not delete expiry dates for unlisted roles. This also fixes another bug I ran into in which expiry dates were being deleted when roles are changed from a source other than the account edit form or the registration (user add) form, such as actions triggered by Views Bulk Operations or the bulk update options at /admin/user/user. Issues mentioned in #561270: Expiration date vanishes if changes are made on other tabs may be related.
  • I’ve changed the expiry date output on the user view page to use php’s date() rather than Drupal’s format_date(), which can’t properly deal with daylight/summer time. The symptom I saw was that the date on the view page was one hour off from the edit page when the expiry date was during a period of the year with different timezone offset than the current time.
  • I changed the format of the expiry date in the edit field, as entered from current data, to ISO 8601 standard “Y-m-d H:i:s”. I hope we can all agree that this is unambiguous to all, and preferable to local formats. May be related to #573404: Description for the expiry date/duration field suggests and incorrect date format.
jessehs’s picture

FileSize
1.78 KB

I create a much simpler patch that just checks to see if role delegation is installed, and alters the code slightly if it is. rolled against 6.x-1.9

sharplesa’s picture

Status: Needs review » Needs work

I applied the patch at #5 and found that it breaks the user/#/edit page.

Test procedure:

A. Establish baseline:

  1. Plain vanilla Drupal install
  2. Install and enable role_expire.
  3. Set the role expiration for a role or two for a user.
  4. Browse to /user/#/edit
  5. Verify that the role expirations are reported correctly, immediately following each role that has an expiration date.

B. Apply patch (without installing role_delegation).

  1. Browse to /user/#/edit.
  2. Do the expiration dates show up? No.
  3. Uncheck and re-check the roles.
  4. Now do the expiration dates show up? Yes.
  5. Do the expiration dates show up in the right place on the page? No. They show up at the end of the form, not immediately following the roles they expire.

C. Install role_delegation.

  1. Browse to /user/#/edit.
  2. Do the expiration dates show up? No. Same as B, above.
  3. etc.

Sorry, this patch doesn't seem to work.

If my test instructions show that I did something wrong, please document the step-by-step so I can get it right.

sharplesa’s picture

Please test role expire and role delegation together. If no one posts anything by Christmas 2011, I propose "close (won't fix)".

Pere Orga’s picture

I've fixed it in 7.x version, see #1899606: Support role assignment modules.

rcodina’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)

Drupal 6 version is unsupported!