diff options
author | Byron Jones <bjones@mozilla.com> | 2012-11-28 09:40:21 +0100 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2012-11-28 09:40:21 +0100 |
commit | 1c5e0c47c92128afebef5614407d84cd72c12b35 (patch) | |
tree | fb192713a69dd8a61774f2fdb308a200d9a4e403 /show_bug.cgi | |
parent | 4096dc51aadfa8344ae649c477827721a4c398ab (diff) | |
download | bugzilla-1c5e0c47c92128afebef5614407d84cd72c12b35.tar.gz bugzilla-1c5e0c47c92128afebef5614407d84cd72c12b35.tar.xz |
Bug 814411: Add a caching mechanism to Bugzilla::Object to avoid querying the database repeatedly for the same information
Diffstat (limited to 'show_bug.cgi')
-rwxr-xr-x | show_bug.cgi | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/show_bug.cgi b/show_bug.cgi index 7ea55e732..14e259e48 100755 --- a/show_bug.cgi +++ b/show_bug.cgi @@ -62,7 +62,7 @@ Bugzilla->switch_to_shadow_db unless $user->id; if ($single) { my $id = $cgi->param('id'); - push @bugs, Bugzilla::Bug->check($id); + push @bugs, Bugzilla::Bug->check({ id => $id, cache => 1 }); if (defined $cgi->param('mark')) { foreach my $range (split ',', $cgi->param('mark')) { if ($range =~ /^(\d+)-(\d+)$/) { @@ -78,8 +78,8 @@ if ($single) { foreach my $id ($cgi->param('id')) { # Be kind enough and accept URLs of the form: id=1,2,3. my @ids = split(/,/, $id); - foreach (@ids) { - my $bug = new Bugzilla::Bug($_); + foreach my $bug_id (@ids) { + my $bug = new Bugzilla::Bug({ id => $bug_id, cache => 1 }); # This is basically a backwards-compatibility hack from when # Bugzilla::Bug->new used to set 'NotPermitted' if you couldn't # see the bug. |