system_sort_by_title() is too useful to be deeply hidden in system.admin.inc.

We already have drupal_sort_weight() in common.inc, so system_sort_by_title() should simply be drupal_sort_title().

CommentFileSizeAuthor
drupal.sort-title.0.patch2.02 KBsun

Comments

dries’s picture

What about making both functions consistent? One has _by_ in its name, the other one has not. :/

sun’s picture

Yeah - renaming those uasort() helper functions to have _by_ in their names would be a good idea, but that's not possible to do for D7, so it is better to have both drupal_sort_*() functions use a consistent naming.

dries’s picture

Status: Needs review » Fixed

Fair enough. Committed.

eric_a’s picture

Quick fix? Erhm, should we just hope that this very useful function was hidden so deeply that no contrib module was using it in its original form...?
EDIT: Agreed, how many people will include system.admin.inc just to reuse this bit of code, but still...

sun’s picture

@Eric_A: Yup, let's just hope that. If I wouldn't know almost any line of code in Drupal core, then I wouldn't have remotely considered that this function exists - and it exists in D7 only, so that alone vastly decreases the amount of potentially affected modules.

Status: Fixed » Closed (fixed)
Issue tags: -Quick fix

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