From c9a245a71d7e487c7e245783f060e6f685c03f01 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Fri, 28 Jan 2022 15:57:49 -1000 Subject: [PATCH] Bug 29878: (follow-up) Change system preference type to multiple AdvancedSearchTypes type must be changed from 'Choice' to 'multiple'. 'Choice' was in fact not the correct type. Also fix options even if they are useless. Other multiple preferences set them. Also replaces split /\,/ with /,/ There is no need to escape. --- catalogue/search.pl | 2 +- installer/data/mysql/atomicupdate/bug-29878.pl | 5 +++-- installer/data/mysql/mandatory/sysprefs.sql | 2 +- opac/opac-search.pl | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index a5419bf3e5..68ada64685 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -720,7 +720,7 @@ It also accounts for the "item-level_itypes" system preference. sub prepare_adv_search_types { my ($types) = @_; - my @advanced_search_types = split( /\,/, $types ); + my @advanced_search_types = split( /,/, $types ); # the index parameter is different for item-level itemtypes my $itype_or_itemtype = diff --git a/installer/data/mysql/atomicupdate/bug-29878.pl b/installer/data/mysql/atomicupdate/bug-29878.pl index f8a9ce7d8b..f3a65b8599 100755 --- a/installer/data/mysql/atomicupdate/bug-29878.pl +++ b/installer/data/mysql/atomicupdate/bug-29878.pl @@ -8,8 +8,9 @@ return { my $dbh = $args->{dbh}; $dbh->do(q{ - UPDATE systempreferences SET value = REPLACE(value, '|', ',') + UPDATE systempreferences + SET value = REPLACE(value, '|', ','), options = 'itemtypes,ccode,loc', type = 'multiple' WHERE variable IN ('AdvancedSearchTypes') }); }, -} +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 9cdd4f64ee..3f3bfedd78 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -15,7 +15,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('AddressFormat','us','us|de|fr','Choose format to display postal addresses', 'Choice'), ('advancedMARCeditor','0','','If ON, the MARC editor won\'t display field/subfield descriptions','YesNo'), ('AdvancedSearchLanguages','','','ISO 639-2 codes of languages you wish to see appear as an Advanced search option. Example: eng|fre|ita','Textarea'), -('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields comprise the Type limit in the advanced search','Choice'), +('AdvancedSearchTypes','itemtypes','itemtypes,ccode,loc','Select which set of fields comprise the Type limit in the advanced search','multiple'), ('AgeRestrictionMarker','',NULL,'Markers for age restriction indication, e.g. FSK|PEGI|Age|','free'), ('AgeRestrictionOverride','0',NULL,'Allow staff to check out an item with age restriction.','YesNo'), ('AggressiveMatchOnISBN','0', NULL,'If enabled, attempt to match aggressively by trying all variations of the ISBNs in the imported record as a phrase in the ISBN fields of already cataloged records when matching on ISBN with the record import tool','YesNo'), diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 5fd4be435e..da5c874422 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -240,7 +240,7 @@ my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':' my @advancedsearchesloop; my $cnt; my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes") || "itemtypes"; -my @advanced_search_types = split(/\,/, $advanced_search_types); +my @advanced_search_types = split(/,/, $advanced_search_types); my $hidingrules = C4::Context->yaml_preference('OpacHiddenItems') // {}; -- 2.34.0