-
-
Notifications
You must be signed in to change notification settings - Fork 29
Resurrect patches from unstable branch #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
be26116
7d5e31e
fd2cc92
30c5eab
10f2057
92e6a73
529fe30
59aba64
3e0ef11
cb8a64e
8e5e1b6
46b975e
b7abfa9
f344c52
f0b8f4f
7c1a336
43c1f45
f8db696
a21b7bb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -46,6 +46,7 @@ use File::Spec::Functions; | |||||
use Safe; | ||||||
use JSON::XS qw(decode_json); | ||||||
use Scope::Guard; | ||||||
use URI; | ||||||
|
||||||
use parent qw(Bugzilla::CPAN); | ||||||
|
||||||
|
@@ -124,6 +125,14 @@ sub template_inner { | |||||
} | ||||||
|
||||||
sub extensions { | ||||||
# Guard against extensions querying the extension list during initialization | ||||||
# (through this method or has_extension). | ||||||
# The extension list is not fully populated at that point, | ||||||
# so the results would not be meaningful. | ||||||
state $recursive = 0; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
die "Recursive attempt to load/query extensions" if $recursive; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
$recursive = 1; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, applied these in #66 |
||||||
|
||||||
state $extensions; | ||||||
return $extensions if $extensions; | ||||||
my $extension_packages = Bugzilla::Extension->load_all(); | ||||||
|
@@ -133,9 +142,20 @@ sub extensions { | |||||
push @$extensions, $package; | ||||||
} | ||||||
} | ||||||
$recursive = 0; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
return $extensions; | ||||||
} | ||||||
|
||||||
sub has_extension { | ||||||
my ($class, $name) = @_; | ||||||
my $cache = $class->request_cache; | ||||||
if (!$cache->{extensions_hash}) { | ||||||
my %extensions = map { $_->NAME => 1 } @{Bugzilla->extensions}; | ||||||
$cache->{extensions_hash} = \%extensions; | ||||||
} | ||||||
return exists $cache->{extensions_hash}{$name}; | ||||||
} | ||||||
|
||||||
sub cgi { | ||||||
return request_cache->{cgi} ||= Bugzilla::CGI->new; | ||||||
} | ||||||
|
@@ -162,6 +182,12 @@ sub localconfig { | |||||
||= Bugzilla::Localconfig->new(read_localconfig()); | ||||||
} | ||||||
|
||||||
sub urlbase { | ||||||
my ($class) = @_; | ||||||
|
||||||
# Since this could be modified, we have to return a new one every time. | ||||||
return URI->new($class->localconfig->{urlbase}); | ||||||
} | ||||||
|
||||||
sub params { | ||||||
return request_cache->{params} ||= Bugzilla::Config::read_param_file(); | ||||||
|
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.