summaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-11-18 08:01:40 +0100
committermkanat%bugzilla.org <>2009-11-18 08:01:40 +0100
commitbc19f61c0c33e71a00dcc8e4ca3e791a9e3b661d (patch)
tree4a6b0e7a7800545f9083fe70fed45e3c9c0d1edf /Bugzilla.pm
parent900f8b1d1eacf44dbfd8d9c8b414b472f492abe8 (diff)
downloadbugzilla-bc19f61c0c33e71a00dcc8e4ca3e791a9e3b661d.tar.gz
bugzilla-bc19f61c0c33e71a00dcc8e4ca3e791a9e3b661d.tar.xz
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 <mkanat@bugzilla.org> r=LpSolit, a=mkanat
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r--Bugzilla.pm6
1 files changed, 5 insertions, 1 deletions
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;
}