Commit 3bdb6be5 authored by bbaetz%acm.org's avatar bbaetz%acm.org

Bug 193575 - Internal server error from votes.cgi

patch by bugzilla@chimpychompy.org (GavinS) r=bbaetz, a=justdave
parent 4f6b75a6
...@@ -135,7 +135,8 @@ sub show_user { ...@@ -135,7 +135,8 @@ sub show_user {
# special error handling should go away. # special error handling should go away.
$who || ThrowUserError("invalid_username", {name => $name}); $who || ThrowUserError("invalid_username", {name => $name});
my $canedit = 1 if ($name eq Bugzilla->user->login); my $canedit = 1 if (Bugzilla->user &&
$name eq Bugzilla->user->login);
SendSQL("LOCK TABLES bugs READ, products READ, votes WRITE, SendSQL("LOCK TABLES bugs READ, products READ, votes WRITE,
cc READ, bug_group_map READ, user_group_map READ, cc READ, bug_group_map READ, user_group_map READ,
...@@ -200,6 +201,10 @@ sub show_user { ...@@ -200,6 +201,10 @@ sub show_user {
opened => IsOpenedState($status) }); opened => IsOpenedState($status) });
} }
# In case we didn't populate this earlier (i.e. an error, or
# a not logged in user viewing a users votes)
$maxvotesperbug{$product} ||= 0;
$onevoteonly = 1 if (min($::prodmaxvotes{$product}, $onevoteonly = 1 if (min($::prodmaxvotes{$product},
$maxvotesperbug{$product}) == 1); $maxvotesperbug{$product}) == 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment