From 890a605cb9e76c205c4356d9ae1d4f59ef173ce6 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Tue, 21 Jan 2014 00:41:00 -0500 Subject: [PATCH] Bug 11587 - IsSuperLibrarian generates warnings This corrects line 1250 of C4/Context.pm to be: return ($userenv->{flags}//0) % 2; And thus avoids an uninitialized value used in the modulus. TEST PLAN --------- 1) Apply the first patch (to update t/Context.t) 2) prove -v t/Context.t -- This should fail tests 7 and 8 3) Apply this patch (to fix C4/Context.pm) 4) prove -v t/Context.t -- All tests should succeed Signed-off-by: Chris Cormack --- C4/Context.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Context.pm b/C4/Context.pm index 3914420..8dc67f2 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -1247,7 +1247,7 @@ sub IsSuperLibrarian { return 1; } - return $userenv->{flags} % 2; + return ($userenv->{flags}//0) % 2; } 1; -- 1.8.5.2