From: Mark Tompsett Date: Tue, 21 Jan 2014 05:41:00 +0000 (-0500) Subject: Bug 11587: get rid of warnings generated by IsSuperLibrarian with anonymous sessions X-Git-Tag: v3.16.00-beta~673 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;h=bf3b1aac7b7bc422bea26bb2c045be69d93ef0bf;p=koha-ffzg.git Bug 11587: get rid of warnings generated by IsSuperLibrarian with anonymous sessions 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 Signed-off-by: Jonathan Druart Signed-off-by: Galen Charlton --- diff --git a/C4/Context.pm b/C4/Context.pm index f58092d892..bf87efaf84 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -1251,7 +1251,7 @@ sub IsSuperLibrarian { return 1; } - return $userenv->{flags} % 2; + return ($userenv->{flags}//0) % 2; } 1;