The permissions page appears to be in alphabetical order by internal module name rather than displayed module name. This makes it very difficult to scroll through and find permissions for a module. For instance, the Content Translation module (translation.module) is listed with the T section instead of in the C section.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

brianV’s picture

Patch attached which *should* sort these alphabetically.

brianV’s picture

Status: Active » Needs review

oops, forgot to set to CNR.

Also, there are some whitespace fixes in there that my IDE threw in.

jhodgdon’s picture

brianV - will this work correctly if the page is displayed in another language? i.e. it needs to sort by the actual name that will be displayed (translated into the interface language). I don't know if your patch is doing that or not?

jhodgdon’s picture

The whitespace changes are all good, by the way (removing spaces that were at the end of lines).

I will test this shortly to see if it works with translation. And in general.

Status: Needs review » Needs work

The last submitted patch failed testing.

jhodgdon’s picture

This patch seems to totally break the permisisons page -- all I can see is Forum permissions, and all the other modules' permissions went away.

brianV’s picture

@jhodgon: It should work with translation, since the text it's sorting on is the display text.

I am going to take a look at these fails...

jhodgdon’s picture

Just as a note, without any patch, the order I am currently seeing on the Permisisons page is (I think I have all the core modules turned on, as I've been working on help screens) (and it's a fresh CVS update and install from this morning):

Block, Aggregator, Book, Comment, Contact, Dashboard, Filter, Image, Locale, Menu, Node, Path, PHP Filter, Poll, Search, Shortcut, Testing, Statistics, System, Taxonomy, Toolbar, Content Translation, Upload, User, Forum.

It's hard to tell what is determining that order -- it's not in machine-name order either!

jhodgdon’s picture

It looks like module_implements() has a $sort=TRUE parameter you can pass to make the list sorted by module name...
http://api.drupal.org/api/function/module_implements/7

brianV’s picture

@jhodgon:

By default, the modules called are ordered by weight and filename. A simple change to the call to module_implements (as in the attached patch) orders them by machine name, which is a good improvement for starters.

Still looking at why the initial patch failed, though, as that's obviously the optimal approach.

jhodgdon’s picture

I think what you are trying to do, sorting by $module->name, is hte same as what module_implements($sort = TRUE) does. However, this field $module->name is coming straight from the database and is NOT translated.

So you need to do something other than that, for it to work with translations.

Actually, I'm not sure where the translation of all of that permissions text is happening, come to think of it, or even if it is happening. Hopefully?

jhodgdon’s picture

I also think that sorting by machine name is not much of an improvement.

brianV’s picture

Status: Needs work » Needs review
FileSize
2.01 KB

I must be asleep at my desk. The attached patch should work to properly alphabetize the modules by display name.

With respect to translation, I recall other issues where that was hashed over. The consensus is that module names shouldn't be translated as they are proper names.

I think this patch should do it for this issue; translation of module names on the permissions page should be split off into it's own issue and debate.

Edit: Here is the module name translation debate issue: #632896: Rollback translation of module names

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

This patch works for me, looks good, etc.

I am not going to re-open the translation can of worms -- I stand corrected (or at least overruled). :)

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)
Issue tags: -D7UX

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