From 0b80296863ed90536c93d752da11e381c34d0960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20V=C3=A9ron?= Date: Fri, 18 Apr 2014 15:42:30 +0200 Subject: [PATCH] Bug 12136 - Problem in opac-topissues.pl if AdvancedSearchTypes has multiple values (separated by pipes) This patch fixes empty dropdown list if AdvancedSearchTypes contains multiple values. It defaults the dropdown to "All item types". If AdvancedSearchTypes contains ccode, it displays "All collections" To test: 1) Set OpacTopissue preferende to "Allow" 2) Set AdvancedSearchTypes to an empty value -> "Most popular" displays "Limit to" with "All item types" 3) Set AdvancedSearchTypes to 'itemtypes' -> "Most popular" displays "Limit to" with "All item types" 4) Set AdvancedSearchTypes to 'ccode' -> "Most popular" displays "Limit to" with "All collections" 5) Set AdvancedSearchTypes to 'ccode|itemtypes' or 'itemtypes|ccode' or 'ccode' -> "Most popular" should now display "Limit to" with "All collections" --- opac/opac-topissues.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/opac/opac-topissues.pl b/opac/opac-topissues.pl index 0afc692..c212532 100755 --- a/opac/opac-topissues.pl +++ b/opac/opac-topissues.pl @@ -69,7 +69,13 @@ if (!$do_it && C4::Context->userenv && C4::Context->userenv->{'branch'} ) { } my $itemtype = $input->param('itemtype') || ''; my $timeLimit = $input->param('timeLimit') || 3; -my $advanced_search_types = C4::Context->preference('AdvancedSearchTypes'); + +#Preliminary fix for bug 12136 with pipe chars in AdvancedSearchTypes +my $raw_advanced_search_types = C4::Context->preference('AdvancedSearchTypes'); +my $advanced_search_types = 'itemtypes'; +if ('ccode' =~ $raw_advanced_search_types) { + $advanced_search_types ='ccode'; +} my $whereclause = ''; $whereclause .= ' AND items.homebranch='.$dbh->quote($branch) if ($branch); -- 1.7.10.4