Convert uasort to array_multisort in \Drupal\Core\Plugin\CategorizingPluginManagerTrait::getSortedDefinitions()

Created on 4 November 2016, over 7 years ago
Updated 18 April 2023, about 1 year ago

Problem/Motivation

Due to a PHP bug (https://bugs.php.net/bug.php?id=50688), uasort is unsafe to use in many circumstances

See #2762549: Drupal\field\Tests\Update\FieldUpdateTest, Drupal\views\Tests\Update\EntityViewsDataUpdateTest and Drupal\comment\Tests\CommentFieldsTest fail on 8.1.x → for an example.

Proposed resolution

Convert to using array_multisort().

Remaining tasks

Decide if this needs to be done since The PHP bug #5068 Using exceptions inside usort() callback function causes a warning is fixed in PHP 7.

User interface changes

API changes

Data model changes

📌 Task
Status

Needs work

Version

10.1 ✨

Component
Plugin  →

Last updated about 16 hours ago

Created by

🇺🇸United States tim.plunkett Philadelphia

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024