From b772969cddce53d72bfd27bfda0ee094b1332e9d Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 18 Apr 2014 08:27:35 -0400 Subject: [PATCH] Bug 12080: (follow-up) fix test failure and warnings in Bookseller.t Signed-off-by: Katrin Fischer Fixes the tests as promised. Signed-off-by: Galen Charlton --- C4/Serials.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index 9fc9ad82cc..76b3f0bc39 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -744,7 +744,7 @@ sub SearchSubscriptions { !C4::Context->IsSuperLibrarian() && !C4::Auth::haspermission( $userid, {serials => 'superserials'}); } - my $user_branch = C4::Context->userenv->{'branch'}; + my $user_branch = C4::Context->userenv ? C4::Context->userenv->{'branch'} : q{}; for my $subscription ( @$results ) { $subscription->{cannotedit} = not can_edit_subscription( $subscription ); $subscription->{cannotdisplay} = @@ -1540,14 +1540,14 @@ sub NewSubscription { my $pattern = C4::Serials::Numberpattern::GetSubscriptionNumberpattern($subscription->{numberpattern}); # calculate issue number - my $serialseq = GetSeq($subscription, $pattern); + my $serialseq = GetSeq($subscription, $pattern) || q{}; $query = qq| INSERT INTO serial (serialseq,subscriptionid,biblionumber,status, planneddate, publisheddate) VALUES (?,?,?,?,?,?) |; $sth = $dbh->prepare($query); - $sth->execute( "$serialseq", $subscriptionid, $biblionumber, 1, $firstacquidate, $firstacquidate ); + $sth->execute( $serialseq, $subscriptionid, $biblionumber, 1, $firstacquidate, $firstacquidate ); logaction( "SERIAL", "ADD", $subscriptionid, "" ) if C4::Context->preference("SubscriptionLog"); -- 2.39.5