permissions are sorted by title but with the wrong comparison operator

Created on 26 March 2023, almost 2 years ago
Updated 31 January 2024, about 1 year ago

Problem/Motivation

PermissionHandler::sortPermissions() sorts all permissions, by module and then by title.

But it uses <=> which for strings compares just the string length (AFAICT). This gives results that seem wrong - shorter permissions are sorted first.

For example, I am getting this order:

- use bar
- use foo
- use bar in specific way alpha
- use bar in specific way beta
- use foo in another specific way

The bar and foo should come together, but they don't.

Steps to reproduce

Proposed resolution

It should use strcasecmp() instead.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Closed: duplicate

Version

11.0 🔥

Component
User system 

Last updated 1 day ago

Created by

🇬🇧United Kingdom joachim

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

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.71.5 2024