Closed Bug 193575 Opened 17 years ago Closed 17 years ago

'Internal Server Error ' from votes.cgi assuming a user is logged in

Categories

(Bugzilla :: Bugzilla-General, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
Bugzilla 2.18

People

(Reporter: bugzilla, Assigned: bugzilla)

References

Details

Attachments

(2 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2b) Gecko/20021016
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2b) Gecko/20021016

[Sun Feb 16 16:28:04 2003] votes.cgi: Use of uninitialized value in string eq at
/var/www/html/bugzilla_testing/votes.cgi line 131.
[Sun Feb 16 16:28:04 2003] votes.cgi: Use of uninitialized value in numeric lt
(<) at Bugzilla/Util.pm line 125.
[Sun Feb 16 16:28:04 2003] votes.cgi: Use of uninitialized value in numeric eq
(==) at /var/www/html/bugzilla_testing/votes.cgi line 196.
[Sun Feb 16 16:28:05 2003] votes.cgi: Argument "" isn't numeric in numeric lt
(<) at data/template/en/default/bug/votes/list-for-user.html.tmpl line 83.
[Sun Feb 16 16:28:05 2003] votes.cgi: Argument "" isn't numeric in numeric gt
(>) at data/template/en/default/bug/votes/list-for-user.html.tmpl line 83.


Reproducible: Always

Steps to Reproduce:
1. logout of bugzilla (remove login cookie)
2. view voters for a bug with votes
3. click a username to view votes a user has made

Actual Results:  
Things work (i.e. voting details displayed), but httpd log errors are generated

Expected Results:  
No log errors

Basically, votes.cgi assumes that there is a login cookie at line 131, and this
leads to the warnings mentioned above
Blocks: 86268
*** Bug 193583 has been marked as a duplicate of this bug. ***
This now causes an internal server error. I think this has changed because of
the recent change to use Bugzilla->user

The following line is what fails when the user is not logged in:

[votes.cgi:138]

>    my $canedit = 1 if ($name eq Bugzilla->user->login);

giving an error of:

> Can't call method "login" on an undefined value at
> /home/gavins/www/bugzilla_votes_warning/votes.cgi line 138.

This can be reproduced by ensuring you are not logged-in to landfill
bugzilla-tip, and going to the following url and clicking on the user to view
their votes..

http://landfill.bugzilla.org/bugzilla-tip/votes.cgi?action=show_bug&bug_id=100
Assignee: justdave → bugzilla
Severity: minor → normal
Summary: httpd log errors from votes.cgi assuming a user is logged in → 'Internal Server Error ' from votes.cgi assuming a user is logged in
Mine.
Assignee: bugzilla → bbaetz
Status: UNCONFIRMED → NEW
Ever confirmed: true
Target Milestone: --- → Bugzilla 2.18
Attached patch FixSplinter Review
Check we have a user before determining their login.
Attachment #125612 - Flags: review?(justdave)
This includes the server error fix and also fixes some warnings later on. We
used to only populate %maxvotesperbug if we thought the user was editing their
own votes, but we later assumed it was setup anyway. We now always populate
%maxvotesperbug
Comment on attachment 125628 [details] [diff] [review]
Fix to server error and also some httpd log warnings

I'd rather we didn't bother generating it, and instead fixed the code which
used it.

$maxvotesperbug{$product} ||= 0 is probably what is needed, just before the
use.
Attachment #125628 - Flags: review-
Changed as suggested
Attachment #125628 - Attachment is obsolete: true
Comment on attachment 125639 [details] [diff] [review]
Fix to server error and also some httpd log warnings V2

r=bbaetz
Attachment #125639 - Flags: review+
Flags: approval?
Flags: approval? → approval+
Attachment #125612 - Flags: review?(justdave)
->patch author
Assignee: bbaetz → bugzilla
Fixed.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.