From bc19f61c0c33e71a00dcc8e4ca3e791a9e3b661d Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Wed, 18 Nov 2009 07:01:40 +0000 Subject: Fix for Bug 527505: Make t/001compile.t work even after Bugzilla::Install::CPAN messes with @INC, and make Bugzilla->feature work during mod_perl.pl. Patch by Max Kanat-Alexander r=LpSolit, a=mkanat --- Bugzilla.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Bugzilla.pm') diff --git a/Bugzilla.pm b/Bugzilla.pm index dc275b34f..3c547b980 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -555,7 +555,11 @@ sub local_timezone { sub request_cache { if ($ENV{MOD_PERL}) { require Apache2::RequestUtil; - return Apache2::RequestUtil->request->pnotes(); + # Sometimes (for example, during mod_perl.pl), the request + # object isn't available, and we should use $_request_cache instead. + my $request = eval { Apache2::RequestUtil->request }; + return $_request_cache if !$request; + return $request->pnotes(); } return $_request_cache; } -- cgit v1.2.3-24-g4f1b