Themes are ordered by filename, and not by info name on admin/build/themes.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rstamm’s picture

This patch reduces redundant code.

Pancho’s picture

FileSize
907 bytes

Changing D6 API is not acceptable anymore. Therefore I removed everything that might break contrib modules.
+1 The rest is okay for now and makes sense.

Don't forget to leave this open after committing in D6, to commit the rest of the patch in #1 for D7.

dropcube’s picture

Status: Needs review » Reviewed & tested by the community

Tested. The themes are ordered by info name correctly after applying the patch. It changes the sort function from ksort to uasort and uses the comparison function system_sort_modules_by_info_name.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed. It would be great to rename that function in D7, so it reflects what it does actually.

dropcube’s picture

Title: Themes are ordered by filename, not display name. » Callback function to sort by info name
Version: 6.x-dev » 7.x-dev
Status: Fixed » Needs work

Rename the function system_sort_modules_by_info_name to system_sort_by_info_name as suggested in #1
The callback function is used to sort modules and themes, not only modules.

rstamm’s picture

Title: Callback function to sort by info name » Themes are ordered by filename, not display name
Version: 7.x-dev » 6.x-dev
Status: Needs work » Needs review
FileSize
672 bytes

Administration themes are ordered by filename, and not by info name.

Pancho’s picture

+1 The same thing in green... looks good, is a one-liner, and works as expected. RTBC?

dropcube’s picture

Status: Needs review » Reviewed & tested by the community

It works fine, and is RTBC as far as I can see.

Check also this issue a theme listing table is also displayed at the users account edit page if they have "select different theme".

Pancho’s picture

Oh my god... I just took a look at all these places where themes are being listed. There is so much code duplication and it's all spread out in system.module, system.admin.inc and theme.inc. Well, for now I guess, we can't change that, but maybe we should put that on our wishlist for D7...?

Just a notice of mine, the patch is indeed okay.

dropcube’s picture

Pancho: Yes, there is a lot code duplication that should be grouped and reused in the theme listing forms.

Just a notice of mine, the patch is indeed okay.

The patch in this issue or the patch in that issue ?. I noted that you have reviewed this patch before.

Pancho’s picture

Status: Reviewed & tested by the community » Needs review

The patch in this issue or the patch in that issue

This one here, of course. Comments to the other patch obviously belong to #211051...

There are two reasons I set this back to CNR, though:

  • If we touch the "administration theme" form anyway, wouldn't we want to render it just the way theme listings are rendered elsewhere (i.e. with screenshot and info)?
  • I wonder whether we could clean up the code duplication at least partly without changing anything in the API?

Any suggestions?

Gábor Hojtsy’s picture

Status: Needs review » Fixed

Pancho: Let's not wrestle with modifying how the admin theme list looks. I committed the patch in #6 to improve listing consistency. I'd say Drupal 7 should have an admin theme selection as part of the themes settings page, not this separated, so duplicating the screenshot based theme list is not the way to go IMHO.

Pancho’s picture

No need for wrestling... I'm convinced! :)

Anonymous’s picture

Status: Fixed » Closed (fixed)

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