Order relevant user/role/access forms by Role Weight

Owen Barton - January 15, 2008 - 22:57
Project:Role Weights
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Here is a patch to order the columns on the /admin/user/access page by role weight. Pretty straightforward - I don't know if there is any point in adding a toggle to switch this on or off (the default alphabetical ordering is not much use if you have a lot of roles). I was actually thought (from the module name at least!) that this is what role weights did...so now it does!

Note there is also the patch for the roles page table over at http://drupal.org/node/114037 (a somewhat tricker case).

AttachmentSize
role_weights_access_page.patch1.08 KB

#1

leafish_paul - January 30, 2008 - 14:26

Awesome, thank you. I think you're right - shall we assume that if one has enabled this module, then re-ordering the Access Control page is desired, without option? We don't have an admin/settings/role_weights page, so adding one for this does seem a bit daft.

Will check the patch out - thanks again.

#2

leafish_paul - January 30, 2008 - 14:59
Status:needs review» reviewed & tested by the community

Patch works a treat - will commit this to 5.x unless I hear any complaints re: no settings page?

Thanks again.

#3

leafish_paul - January 28, 2009 - 16:16

Just a thought, but if we have no explicit setting for this re-ordering on user access or user roles forms, then I'd like the re-ordering to be done across the board - ie we'd need a solution for ordering the user roles form (#114037: Order admin_user_roles by weight?) too.

#4

leafish_paul - January 28, 2009 - 16:17
Title:Order user access page to role weight» Order relevant user/role/access forms by Role Weight
Status:reviewed & tested by the community» needs work

Merging #114037: Order admin_user_roles by weight? here, as per comment #3. Merged patch soon.

#5

leafish_paul - May 12, 2008 - 14:15

Not sure I like the weight actually being shown on the admin_user_roles form, but this merged patch should do what we want.

AttachmentSize
role_weights_210457-2.patch 2.69 KB

#6

leafish_paul - May 12, 2008 - 14:16
Status:needs work» needs review

#7

leafish_paul - January 28, 2009 - 14:49

Better patch - no weight is shown on the admin_user_roles form now but its still sorted. Also added a system variable 'role_weights_reorder_forms' which allows for the sorting on admin_user_roles form and the user_admin_perm form to be toggled.

I didn't want to add an entire settings page just for this system variable - I guessed that if the user was able to manage roles and permissions, then adding a setting to the $conf variable to ENABLE sorting of these forms by role weight should suffice?

So, if you test this patch, add:

<?php
 
# role weights re-order admin forms setting
 
$conf = array(
   
'role_weights_reorder_forms' => TRUE,
  );
?>

to the $conf array in your settings.php file.

Will be committing this and some other changes very soon for the next 5.x-1.x release - please shout now if you would like a settings page for this!

AttachmentSize
role_weights_210457-3.patch 2.16 KB

#8

leafish_paul - January 28, 2009 - 15:04

Minor change - if no weight is set (NULL) we assume a weight of zero. Without this, when new roles were added on admin_user_roles, no weight is set and so the sorting fails - the new role appeared at the top of the list.

AttachmentSize
role_weights_210457-4.patch 2.39 KB

#9

leafish_paul - January 28, 2009 - 16:15
Status:needs review» fixed

Committed to 5.x-1.x-dev and HEAD.

#10

System Message - February 11, 2009 - 16:20
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.