Bug 27680: Add support for param[] syntax
authorTomas Cohen Arazi <tomascohen@theke.io>
Fri, 26 Feb 2021 17:44:23 +0000 (14:44 -0300)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Fri, 5 Mar 2021 21:32:11 +0000 (21:32 +0000)
commit01701a2389c4a5593cc7b09a6c6012c8ab30ec1f
tree11fa45cac1031b0c511992836ab97fd371aa5ad3
parent390fb4939e2c96422a0113a1cd2b5f1637fbd9ca
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>
(cherry picked from commit 95fda2115d9c0106072eca39ebf7cf6fe02c7edf)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Koha/REST/Plugin/Query.pm
t/db_dependent/Koha/REST/Plugin/Objects.t