Skip to content

desc sort order not working #2

@dahaiexp

Description

@dahaiexp

hi @mhadjimichael ,

Good job on building this script, it's amazing!

BTW, found a small bug:
->setSortColumns([PHPivot::SORT_DESC,PHPivot::SORT_DESC])

seems not working, the desc sort order didn't work.

when I checked the source code, seems the issue is that array_reverse doesn't reverse the array in place, so need to assign the result back to the array.
[wrong]
array_reverse($columns_unique_values[$col]);
[correct]
$columns_unique_values[$col]=array_reverse($columns_unique_values[$col]);

Best
Dahai

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions