bug #11511 Change function that orders grid fields (arti0090)

This PR was merged into the 1.7 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Branch?         |  1.7
| Bug fix?        | yes
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | #10676
| License         | MIT


Commits
-------

53ab9a5ddf Change function that sorts given parameters
This commit is contained in:
Grzegorz Sadowski 2020-05-28 14:47:23 +02:00 committed by GitHub
commit d0af87ef4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,7 +49,7 @@ class SortByExtension extends AbstractExtension
$firstProperty = (string) $accessor->getValue($firstElement, $field);
$secondProperty = (string) $accessor->getValue($secondElement, $field);
$result = strcasecmp($firstProperty, $secondProperty);
$result = strnatcasecmp($firstProperty, $secondProperty);
if ('DESC' === $order) {
$result *= -1;
}