Bug 28409: Simplify data validation
Simplify the affectation then trust it.
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
JD Amended patch: remove duplicate comma
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 50db7afeb4)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
This commit is contained in:
parent
b4c29846af
commit
f32d0d41c3
|
|
@ -80,13 +80,7 @@ if (C4::Context->preference("BakerTaylorEnabled")) {
|
|||
|
||||
my $referer = $query->param('referer') || $op;
|
||||
my $category = 1;
|
||||
if ( $query->param('category') && (
|
||||
($query->param('category') == 1) ||
|
||||
($query->param('category') == 2)
|
||||
)
|
||||
){
|
||||
$category = $query->param('category');
|
||||
}
|
||||
$category = 2 if $query->param('category') && $query->param('category') == 2;
|
||||
|
||||
my ( $shelf, $shelfnumber, @messages );
|
||||
|
||||
|
|
@ -115,7 +109,7 @@ if ( $op eq 'add_form' ) {
|
|||
$shelf = Koha::Virtualshelf->new(
|
||||
{ shelfname => scalar $query->param('shelfname'),
|
||||
sortfield => scalar $query->param('sortfield'),
|
||||
category => $category || 1,
|
||||
category => $category,
|
||||
allow_change_from_owner => $allow_changes_from > 0,
|
||||
allow_change_from_others => $allow_changes_from == ANYONE,
|
||||
owner => scalar $loggedinuser,
|
||||
|
|
@ -442,7 +436,7 @@ $template->param(
|
|||
referer => $referer,
|
||||
shelf => $shelf,
|
||||
messages => \@messages,
|
||||
category => ($category == 1 || $category == 2) ? $category : "",
|
||||
category => $category,
|
||||
print => scalar $query->param('print') || 0,
|
||||
listsview => 1,
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue