Bug 24458: Use the ViewPolicy filter on search results
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 11 May 2020 13:10:39 +0000 (10:10 -0300)
committerVictor Grousset/tuxayo <victor@tuxayo.net>
Tue, 9 Jun 2020 16:48:20 +0000 (18:48 +0200)
commit015cc7d4fe81804388dfedd166c0fde5f43b4295
tree4e001f6c93d60a300d27af3be11e75c35637aa7b
parent0f817f4da9439255850f583ba80cb1f0876967a0
Bug 24458: Use the ViewPolicy filter on search results

This patch implements the use of the ViewPolicy record processor filter
inside C4::Search::searchResults. The idea is that the $record_processor
is instantiated once and reused inside the loop. This leaves options for
further optimizations I will do on a follow-up bug.

The filter is applied to the MARC data before it is passed to the XSLT
processor.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Search.t
=> FAIL: This is not implemented, tests fail
3. Apply this patch
4. Repeat 2
5. Feel the joy in your body from a long standing bug being solved
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit e78231f3f63ed49fc65ac653e57159a8aba7fbe2)
C4/Search.pm