Bug 27680: Add support for param[] syntax
authorTomas Cohen Arazi <tomascohen@theke.io>
Fri, 26 Feb 2021 17:44:23 +0000 (14:44 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Thu, 4 Mar 2021 09:41:48 +0000 (10:41 +0100)
commit95fda2115d9c0106072eca39ebf7cf6fe02c7edf
treec5c7f1f01733efd485b3eeeee7edccf441369ae5
parent30f02bee8a6553cbb2828d607aaae9e7d2b6c9f3
Bug 27680: Add support for param[] syntax

While not that common nowadays, it is the syntax PHP uses, and
DataTables also generates such thing in 'traditional' mode. We should
support it as well.

This patch adds support for that. It does so by adding _order_by[] to
the reserved param names, and proper handling on the dbic_merge_sorting
helper.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> SUCCESS: Tests pass!
3- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 27680: (QA follow-up) Minor perlcritic issue

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 79064a88639ba725cc898cb940c85ff3fb1d4bee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/REST/Plugin/Query.pm
t/db_dependent/Koha/REST/Plugin/Objects.t