The permissions colspan for module headings references the wrong part of the form array during theming. It works visually because it counts a part of the array that is always larger than the number of roles because each role is added as a key in the part of $form['role_names']
. For a default minimal install, there is just anonymous and authenticated, which you'll see here are added as keys 1 and 2, along with all the other parts of the form. This means the colspan for the module headings on the permissions page here is 19. Try searching for colspan="19">
on the HTML page source of admin/user/permissions.
array(18) {
["#type"]=>
string(5) "value"
["#value"]=>
array(2) {
[1]=>
string(14) "anonymous user"
[2]=>
string(18) "authenticated user"
}
[1]=>
array(9) {
["#markup"]=>
string(14) "anonymous user"
["#tree"]=>
bool(true)
["#parents"]=>
array(1) {
[0]=>
int(1)
}
["#array_parents"]=>
array(2) {
[0]=>
string(10) "role_names"
[1]=>
int(1)
}
["#weight"]=>
int(0)
["#processed"]=>
bool(false)
["#id"]=>
string(6) "edit-1"
["#defaults_loaded"]=>
bool(true)
["#sorted"]=>
bool(true)
}
[2]=>
array(9) {
["#markup"]=>
string(18) "authenticated user"
["#tree"]=>
bool(true)
["#parents"]=>
array(1) {
[0]=>
int(2)
}
["#array_parents"]=>
array(2) {
[0]=>
string(10) "role_names"
[1]=>
int(2)
}
["#weight"]=>
float(0.001)
["#processed"]=>
bool(false)
["#id"]=>
string(6) "edit-2"
["#defaults_loaded"]=>
bool(true)
["#sorted"]=>
bool(true)
}
["#tree"]=>
bool(false)
["#parents"]=>
array(1) {
[0]=>
string(10) "role_names"
}
["#array_parents"]=>
array(1) {
[0]=>
string(10) "role_names"
}
["#weight"]=>
int(0)
["#processed"]=>
bool(false)
["#description"]=>
string(0) ""
["#title"]=>
string(0) ""
["#attributes"]=>
array(0) {
}
["#required"]=>
bool(false)
["#input"]=>
bool(true)
["#id"]=>
string(15) "edit-role-names"
["#name"]=>
string(10) "role_names"
["#defaults_loaded"]=>
bool(true)
["#sorted"]=>
bool(true)
}
It should reference #value, which is:
array(2) {
[1]=>
string(14) "anonymous user"
[2]=>
string(18) "authenticated user"
}
Comment | File | Size | Author |
---|---|---|---|
user_admin_perm_colspan.patch | 891 bytes | deekayen | |
Comments
Comment #1
pp CreditAttribution: pp commentedI reviewed the patch. It's resolve this problem.
pp
Comment #2
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks!