Great module. My one irritation is that the Views display only shows the Role expiration time as a timestamp, with no indication of which role it's associated with. This is fine if you're only using it for one role, but is confusing for multiple roles... any chance of giving an option to display the relevant role name along with the expiration time?

Comments

adam_b’s picture

Version: 6.x-1.x-dev » 6.x-1.6
Assigned: stewsnooze » Unassigned
Status: Needs work » Active

Subscribe... this is a real pain for my installation as I'm using it for multiple roles, and I can't find a way to work around it.

ETA: can't believe I subscribed to a thread without realising that I'd started in the first place...

stewsnooze’s picture

Version: 6.x-1.6 » 6.x-1.x-dev
Assigned: Unassigned » stewsnooze
Status: Active » Needs review

This is committed to CVS HEAD.

Please review. I'll release soon but test if you can.

adam_b’s picture

Afraid I've no idea how to work with CVS HEAD, but will look at a dev release as soon as it's available :)

stewsnooze’s picture

I've enabled the dev release on the front page of the module but you'll probably have to wait for the packaged version (15th June) to get the views change in there.

adam_b’s picture

Status: Needs review » Needs work
StatusFileSize
new12.93 KB
new7.72 KB
new254 bytes

I've installed the 14 June dev version which has the new fields (role expiration name, role expiration time) so I assume it's the correct one.

Looks good in principle but I'm having a couple of problems:

1. It's sometimes showing expiry dates in the view for roles which have no expiry when I check the user
- see attachments view_shows_expiry.png and role_has_no_expiry.png

2. It's sometimes showing the same role multiple times, with different expiry dates in each instance
- see attachment multiple_role_instances.png

We're also having problems with the expiry date seeming to disappear when you try and edit the user. This looks like #561270: Expiration date vanishes if changes are made on other tabs but I haven't been able to replicate it consistently so haven't added it to that issue - I just mention it here in case it's relevant, since our user admin's had to enter the expiry dates over again in some instances.

adam_b’s picture

StatusFileSize
new40.63 KB
new16.96 KB
new8.15 KB

PNG's didn't work for some reason so am attaching JPGs

stewsnooze’s picture

Version: 6.x-1.6 » 6.x-1.x-dev
Assigned: Unassigned » stewsnooze
Status: Active » Needs work

Can you send me the SQL that Views produced (at the bottom near the Live preview) for this or export the view and send over the .inc file. Lets start with the SQL produced by views

adam_b’s picture

StatusFileSize
new5.08 KB

SQL query:

SELECT users.uid AS uid,
   users.name AS users_name,
   role.name AS role_name,
   role_expire.expiry_timestamp AS role_expire_expiry_timestamp
 FROM users users 
 LEFT JOIN users_roles users_roles ON users.uid = users_roles.uid
 LEFT JOIN role role ON users_roles.rid = role.rid
 LEFT JOIN role_expire role_expire ON users.uid = role_expire.uid
 WHERE users.uid not in ('0')
   ORDER BY users_name ASC

Views export file attached

stewsnooze’s picture

Status: Needs work » Needs review

Hi,

I realised that I hadn't exposed the relationship to the role table. You should rebuild your role and add the Role Expire Role ID field, then add the available role expiry rid relationship which will enforce the 1 to 1 match.

This should be in the new dev roll up which I hope is dated 21 June.

Feedback please?

adam_b’s picture

StatusFileSize
new5.29 KB

Okay, I'm not sure that I understood the instructions but here's what I did:
- added relationship "User: Role expiration Role ID" and made it compulsory
- added fields:
-- "User: Role expiration Role ID" (not displayed)
-- "(RoleID) User: Role expiration name" (using relationship)
-- "User: Role expiration time"

The result is much better and seems correct for most users. The only problem I've found so far is a couple of users which each have two roles listed although they're only subscribed to one.

SQL query is:

SELECT users.uid AS uid,
   users.name AS users_name,
   role_expire.rid AS role_expire_rid,
   role_role_expire.name AS role_role_expire_name,
   role_expire.expiry_timestamp AS role_expire_expiry_timestamp
 FROM users users 
 INNER JOIN role_expire role_expire ON users.uid = role_expire.uid
 INNER JOIN role role_role_expire ON role_expire.rid = role_role_expire.rid
 WHERE users.uid not in ('0')
   ORDER BY users_name ASC

View export file attached -- let me know if you need more information.

stewsnooze’s picture

OK. I'll code to expose the relationship to users as well and you'll need to add that in the Relationship tab also. I'll update this later.

adam_b’s picture

Thanks. Could I ask you to indicate specifically which fields need which relationships? I tried a few alternatives and this was the best setting that I could find.

teliseo’s picture

See patch in #924976: Administration Report on Expiry Dates for a better solution.

sharplesa’s picture

Please check out the patch at http://drupal.org/node/649256#comment-5291110 and see if it doesn't also address this problem.

rcodina’s picture

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

Drupal 6 version is unsupported!