From fd18249965235586deb2e3cc3f4653acd59ecc37 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 12 Apr 2019 07:02:06 +0000 Subject: [PATCH] Bug 22478: (QA follow-up) Handle category in opac-shelves like a boolean The category parameter should be restricted to 1 or 2 (private/public). In order to keep same behavior, no parameter means 1 (private). Note: Adding the same line in intranet counterpart. Test plan [1] Check for category empty, '1a', '11' etc. And with script ;) Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize (cherry picked from commit 3d06afa4cdd9131fb9784a9d76b14a669e35ffc7) Signed-off-by: Lucas Gass --- opac/opac-shelves.pl | 1 + virtualshelves/shelves.pl | 1 + 2 files changed, 2 insertions(+) diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl index c601ea4a95..2a9eda8ef0 100755 --- a/opac/opac-shelves.pl +++ b/opac/opac-shelves.pl @@ -60,6 +60,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ my $op = $query->param('op') || 'list'; my $referer = $query->param('referer') || $op; my $category = $query->param('category') || 1; +$category = 2 if $category ne "1"; my ( $shelf, $shelfnumber, @messages ); if ( $op eq 'add_form' ) { diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl index 6bf3d41727..42806f5d7a 100755 --- a/virtualshelves/shelves.pl +++ b/virtualshelves/shelves.pl @@ -50,6 +50,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my $op = $query->param('op') || 'list'; my $referer = $query->param('referer') || $op; my $category = $query->param('category') || 1; +$category = 2 if $category ne "1"; my ( $shelf, $shelfnumber, @messages ); if ( $op eq 'add_form' ) { -- 2.39.5