Problem/motivation

When #2028499: drupal_sort_weight should be converted to a class goes in, then drupal_sort_weight will be deprecated.

Proposed resolution

Replace all instances of
uasort($operations, 'drupal_sort_weight');
with

uasort($operations, array('Drupal\Component\Utility\SortArray', 'sortByWeightElement'));
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tsphethean’s picture

Issue summary: View changes

Updated issue summary.

tsphethean’s picture

Issue summary: View changes

Updated issue summary.

-enzo-’s picture

Status: Active » Needs review
FileSize
11.36 KB

Hello guys I did a small patch to do this replacement

Status: Needs review » Needs work

The last submitted patch, drupal_sort_weight_with-2029537-1.patch, failed testing.

Anonymous’s picture

Issue summary: View changes

Updated issue summary.

sun’s picture

Issue summary: View changes
Issue tags: +@deprecated
InternetDevels’s picture

Status: Needs work » Needs review
FileSize
8.5 KB

New patch attached.

sun’s picture

Title: Replace instances of drupal_sort_weight with SortArray::sortWeight » Replace drupal_sort_weight() with SortArray::sortByWeightElement() and remove drupal_sort_weight()
Component: other » base system
Status: Needs review » Reviewed & tested by the community
Issue tags: +API clean-up

Thanks!

webchick’s picture

Status: Reviewed & tested by the community » Needs work

No longer applies.

Xano’s picture

Status: Needs work » Needs review
FileSize
8.5 KB

Re-roll.

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Was RTBC before and looks good still.

webchick’s picture

Title: Replace drupal_sort_weight() with SortArray::sortByWeightElement() and remove drupal_sort_weight() » Change notice: Replace drupal_sort_weight() with SortArray::sortByWeightElement() and remove drupal_sort_weight()
Priority: Normal » Major
Status: Reviewed & tested by the community » Active
Issue tags: +Needs change record

Committed and pushed to 8.x. Thanks!

Needs a change notice.

kim.pepper’s picture

Title: Change notice: Replace drupal_sort_weight() with SortArray::sortByWeightElement() and remove drupal_sort_weight() » Replace drupal_sort_weight() with SortArray::sortByWeightElement() and remove drupal_sort_weight()
Status: Active » Fixed
Issue tags: -Needs change record

Change notice created https://drupal.org/node/2181331

Status: Fixed » Closed (fixed)

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