From 3d06afa4cdd9131fb9784a9d76b14a669e35ffc7 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 --- 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 8da67e905f..d8a90a3d43 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 bd1c0d4654..ea84249c86 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