From 4f4946f8dfc8511a02af2cdebf96ea59be57fafc Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 31 Oct 2013 15:37:00 +0000 Subject: [PATCH] Bug 8435: (follow-up) make SearchSubscriptions handle lack of userenv This patch allows t/db_dependent/Bookseller.t to pass. Signed-off-by: Galen Charlton --- C4/Serials.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index da876e2678..5256b13ff8 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -711,8 +711,9 @@ sub SearchSubscriptions { for my $subscription ( @$results ) { $subscription->{cannotedit} = not can_edit_subscription( $subscription ); $subscription->{cannotdisplay} = - ( C4::Context->preference("IndependentBranches") - and $subscription->{branchcode} ne C4::Context->userenv->{'branch'} ) ? 1 : 0; + ( C4::Context->preference("IndependentBranches") && + C4::Context->userenv && + $subscription->{branchcode} ne C4::Context->userenv->{'branch'} ) ? 1 : 0; } return @$results; -- 2.39.5