Bug 12330: [QA Follow-up] Consistency between opac-search and staff client
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Wed, 9 Jul 2014 13:56:54 +0000 (15:56 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 5 Sep 2014 15:06:04 +0000 (12:06 -0300)
In opac-search two regexes are added for the results of splitting the
pref AdvancedSearchTypes, allowing spaces before and after the names.
The same regexes should be added to catalogue/search.pl to have the
same behavior there.

Test plan:
Set AdvancedSearchTypes to "itemtypes  |  ccode |  loc " (no quotes).
Check OPAC and staff with and without this patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
catalogue/search.pl

index dbb75ca..24abcb0 100755 (executable)
@@ -258,6 +258,8 @@ my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes") || "i
 my @advanced_search_types = split(/\|/, $advanced_search_types);
 
 foreach my $advanced_srch_type (@advanced_search_types) {
+    $advanced_srch_type =~ s/^\s*//;
+    $advanced_srch_type =~ s/\s*$//;
    if ($advanced_srch_type eq 'itemtypes') {
    # itemtype is a special case, since it's not defined in authorized values
         my @itypesloop;