From aff8eb22668669c2c641f641c1ee79ec8617c287 Mon Sep 17 00:00:00 2001 From: Anna Heath Date: Wed, 25 Feb 2026 10:03:11 -0800 Subject: [PATCH] Fixes #46 This replaces the deprecated drupal_sort_weight callback with backdrop_sort. --- modules/checkout/commerce_checkout.module | 4 ++-- modules/line_item/commerce_line_item.module | 2 +- modules/order/commerce_order.module | 4 ++-- modules/payment/commerce_payment.module | 2 +- modules/payment/includes/commerce_payment.checkout_pane.inc | 2 +- modules/price/commerce_price.module | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/checkout/commerce_checkout.module b/modules/checkout/commerce_checkout.module index 4069e675..38ba7368 100644 --- a/modules/checkout/commerce_checkout.module +++ b/modules/checkout/commerce_checkout.module @@ -480,7 +480,7 @@ function commerce_checkout_pages() { } } - uasort($checkout_pages, 'drupal_sort_weight'); + backdrop_sort($checkout_pages); // Initialize the previous and next pages. $previous_page_id = NULL; @@ -623,7 +623,7 @@ function commerce_checkout_panes($conditions = array(), $skip_saved_data = FALSE } // Sort the panes by their weight value. - uasort($checkout_panes, 'drupal_sort_weight'); + backdrop_sort($checkout_panes); } // Apply conditions to the returned panes if specified. diff --git a/modules/line_item/commerce_line_item.module b/modules/line_item/commerce_line_item.module index b3c36006..2ff9a612 100644 --- a/modules/line_item/commerce_line_item.module +++ b/modules/line_item/commerce_line_item.module @@ -1591,7 +1591,7 @@ function commerce_line_item_summary_links() { backdrop_alter('commerce_line_item_summary_link_info', $links); // Sort the links by weight and return the array. - uasort($links, 'drupal_sort_weight'); + backdrop_sort($links); } return $links; diff --git a/modules/order/commerce_order.module b/modules/order/commerce_order.module index ddf60488..d6e940a3 100644 --- a/modules/order/commerce_order.module +++ b/modules/order/commerce_order.module @@ -1028,7 +1028,7 @@ function commerce_order_states() { // Give other modules a chance to alter the order states. backdrop_alter('commerce_order_state_info', $order_states); - uasort($order_states, 'drupal_sort_weight'); + backdrop_sort($order_states); } return $order_states; @@ -1137,7 +1137,7 @@ function commerce_order_statuses($conditions = array()) { // Give other modules a chance to alter the order statuses. backdrop_alter('commerce_order_status_info', $order_statuses); - uasort($order_statuses, 'drupal_sort_weight'); + backdrop_sort($order_statuses); } // Apply conditions to the returned statuses if specified. diff --git a/modules/payment/commerce_payment.module b/modules/payment/commerce_payment.module index 54704178..8956a957 100644 --- a/modules/payment/commerce_payment.module +++ b/modules/payment/commerce_payment.module @@ -1158,7 +1158,7 @@ function commerce_payment_totals_rows($totals, $order) { backdrop_alter('commerce_payment_totals_row_info', $rows, $totals, $order); // Sort the rows by weight and return the array. - uasort($rows, 'drupal_sort_weight'); + backdrop_sort($rows); return $rows; } diff --git a/modules/payment/includes/commerce_payment.checkout_pane.inc b/modules/payment/includes/commerce_payment.checkout_pane.inc index 1767fd71..b887b729 100644 --- a/modules/payment/includes/commerce_payment.checkout_pane.inc +++ b/modules/payment/includes/commerce_payment.checkout_pane.inc @@ -59,7 +59,7 @@ function commerce_payment_pane_checkout_form($form, &$form_state, $checkout_pane rules_invoke_all('commerce_payment_methods', $order); // Sort the payment methods array by the enabling Rules' weight values. - uasort($order->payment_methods, 'drupal_sort_weight'); + backdrop_sort($order->payment_methods); // Generate an array of payment method options for the checkout form. $options = array(); diff --git a/modules/price/commerce_price.module b/modules/price/commerce_price.module index c5a95bb5..02948a1c 100644 --- a/modules/price/commerce_price.module +++ b/modules/price/commerce_price.module @@ -604,7 +604,7 @@ function commerce_price_field_formatter_view($entity_type, $entity, $field, $ins backdrop_alter('commerce_price_formatted_components', $components, $item, $entity); // Sort the components by weight. - uasort($components, 'drupal_sort_weight'); + backdrop_sort($components); // Format the prices for display. foreach ($components as $key => &$component) {