Bug 20078: Add accelerated reading indexes to getIndexes
authorNick Clemens <nick@bywatersolutions.com>
Mon, 12 Feb 2018 10:58:35 +0000 (10:58 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Tue, 6 Nov 2018 12:22:47 +0000 (12:22 +0000)
To test:
1 - Find a bib with 526$c and 526$d populated, or populate them
 e.g. 526$a 5.5 | 526$d 14
2 - Try searching for 'arl:5.5' or 'arp:14'
3 - Your record should be returned in results
4 - Add the indexes as dropdowns by entering the following in intranetuserjs:
$(document).ready(function(){
        // Add Accelerated Reading Level to advanced search
    if (window.location.href.indexOf("catalogue/search.pl") > -1) {
        $(".advsearch").append('<option value="arl">Accelerated Reading Level</option>');
    }

    // Add Accelerated Reading Point to advanced search
    if (window.location.href.indexOf("catalogue/search.pl") > -1) {
        $(".advsearch").append('<option value="arp">Accelerated Reading Point</option>');
    }
});
5 - Search using these in the dropdown, your record will not be found
6 - Apply patch
7 - Repeat searches directly and by using dropdown, your record should be returned.
8 - prove t/db_dependent/Search.t

Signed-off-by: Margie Sheppard - Central Kansas Library System CKLS <msheppard@ckls.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
C4/Search.pm
t/db_dependent/Search.t

index 5f8250d..6e81497 100644 (file)
@@ -1089,6 +1089,8 @@ sub getIndexes{
                     'an',
                     'Any',
                     'at',
+                    'arl',
+                    'arp',
                     'au',
                     'aub',
                     'aud',
index f7b95bd..417be53 100644 (file)
@@ -262,6 +262,8 @@ sub run_marc21_search_tests {
 
     my $indexes = C4::Search::getIndexes();
     is(scalar(grep(/^ti$/, @$indexes)), 1, "Title index supported");
+    is(scalar(grep(/^arl$/, @$indexes)), 1, "Accelerated reading level index supported");
+    is(scalar(grep(/^arp$/, @$indexes)), 1, "Accelerated reading point index supported");
 
     my $bibliomodule = new Test::MockModule('C4::Biblio');
 
@@ -972,7 +974,7 @@ sub run_unimarc_search_tests {
 }
 
 subtest 'MARC21 + DOM' => sub {
-    plan tests => 109;
+    plan tests => 111;
     run_marc21_search_tests();
 };