Koha-clms/t/Koha
Tomas Cohen Arazi 741b9a1c73
Bug 24191: Add to_model param to _build_order_atom and dbic_merge_sorting
This patch adds a to_model parameter to dbic_merge_sorting so it is
passed when used (for example from objects.search). The to_model param
is passed along to the _build_order_atom method where it is finally
used.

In the process I wrote tests that reflected some problems in the current
code:
- Mojolicious automatically returns a scalar if a query parameter only
happens once on a request. The code expected an arrayref in every case.
- There's a design issue that forced me to use some hacky code in
_build_order_atom.

The first issue is dealth with, by using Scalar::Util::reftype as the
Perl docs recommend.

The second issue, I don't plan to clean it here, as there's ongoing work
on a Koha::Objects->search_from_api method that will obsolete this code
most probably (see bug 23893 for a better picture of where the mappings
will be living soon).

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

Sponsored-by: ByWater Solutions
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-12-10 16:17:10 +00:00
..
Authority Bug 14769: (QA follow-up) Remove global var $cached_indicators 2018-04-12 10:50:36 -03:00
I18N/po/xx_XX/LC_MESSAGES Bug 15395: Allow correct handling of plural translation 2018-11-08 15:55:50 +00:00
Plugins Bug 23050: (QA follow-up) Add Koha::Plugins::Tab class 2019-11-05 08:13:59 +00:00
REST/Plugin Bug 24191: Add to_model param to _build_order_atom and dbic_merge_sorting 2019-12-10 16:17:10 +00:00
SearchEngine Bug 23089: Unit tests 2019-11-03 07:33:56 +00:00
Util Bug 21560: Unit test for Koha::Util::OpenDocument 2019-03-15 12:02:46 +00:00
Config.t Bug 19760: Fix Config.t test 2017-12-22 14:04:52 -03:00
Exceptions.t Bug 23425: (QA follow-up) Keep it generic 2019-09-23 10:41:58 +01:00
I18N.t Bug 15395: Allow correct handling of plural translation 2018-11-08 15:55:50 +00:00
ItemType.t Bug 12748: (QA followup) make new tests pass 2016-04-26 20:20:14 +00:00
RDF.t Bug 18586: Create module to mint RDF subject URIs 2018-08-09 12:11:16 +00:00
Script.t Bug 22600: Set 'commandline' interface appropriately 2019-04-10 19:43:11 +00:00
Script_cron.t Bug 22600: Set 'commandline' interface appropriately 2019-04-10 19:43:11 +00:00
Z3950responder.t Bug 13937: Fix issues found in QA 2019-10-08 14:39:50 +01:00