Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#1456 closed Bug (fixed)

Sorting in API without order

Reported by: SteveG Owned by:
Priority: low Milestone: Piwik 0.6.4
Component: Core Keywords: API sorting order
Cc: Sensitive: no

Description

It is nice, that it's adjustable to sort the API-responses as needed.
Is there a reason why filter_sort_column and filter_sort_order have both to be given in a request to get it sorted. I would expect that sorting a column without a given order behaves like any database and orders asc by default.

It's not realy a bug, but i just wondered why sorting didn't apply without filter_sort_order.

I guess it's easy to change this. Giving a default value for filter_sort_order in core/API/DataTableGenericFilter.php should fix it.

Change History (3)

comment:1 Changed 4 years ago by matt (mattab)

sounds good, but filter_sort_order should default to 'desc' in our case

comment:2 Changed 4 years ago by SteveG (sgiehl)

  • Resolution set to fixed
  • Status changed from new to closed

(In [2481]) fixes #1456 added default sorting order (desc) if filter_sort_order is not given

comment:3 Changed 4 years ago by matt (mattab)

(In [2484]) Refs #1456

Fixing failing integration tests now that Sort filter is called by default with 'desc'.

Note: to fix integration tests, compare tests/integration/processed and tests/integration/expected/ with a file compare tool (like WinMerge on windows). If it looks good, copy processed/* files over the expected/* and tests will pass.

Note: See TracTickets for help on using tickets.