@AltamashShaikh opened this Pull Request on October 11th 2021 Contributor

Description:

Fixed in place sorting order bug for PHP version >= 8
Fixes : #18130

Review

@AltamashShaikh commented on October 12th 2021 Contributor

Is it maybe better for this to try sorting on something other than 'name' if $a['name'] === $b['name'] to ensure consistent results?

We have total 3 fields

  1. name (Eg: Visits)
  2. id (Eg: nb_visits)
  3. documentation

The next possible is id and that seems to work as expected.

Something like this

usort($metrics, function ($a, $b) {
            if ($a['name'] === $b['name']) {
                $value = strcmp($a['id'], $b['id']);
            } else {
                $value = strcmp($a['name'], $b['name']);
            }

            return $value;
        });
@tsteur commented on October 12th 2021 Member

@AltamashShaikh seems some test is failing now in https://app.travis-ci.com/github/matomo-org/matomo/jobs/542640794#L760 and needs to be fixed.

same is also visible in the two glossary screenshots which need to be updated: https://builds-artifacts.matomo.org/matomo-org/matomo/4.x-dev/49950/

@AltamashShaikh commented on October 13th 2021 Contributor

@AltamashShaikh seems some test is failing now in https://app.travis-ci.com/github/matomo-org/matomo/jobs/542640794#L760 and needs to be fixed.

same is also visible in the two glossary screenshots which need to be updated: https://builds-artifacts.matomo.org/matomo-org/matomo/4.x-dev/49950/

@tsteur Does it looks good to you now ?

This Pull Request was closed on October 13th 2021
Powered by GitHub Issue Mirror