Closed
Bug 254430
Opened 20 years ago
Closed 20 years ago
can_see_bug borks for logged out user.
Categories
(Bugzilla :: Creating/Changing Bugs, defect, P1)
Tracking
()
RESOLVED
FIXED
Bugzilla 2.20
People
(Reporter: kiko, Assigned: bugreport)
Details
(Keywords: regression)
Attachments
(1 file, 1 obsolete file)
547 bytes,
patch
|
kiko
:
review+
erik
:
review+
|
Details | Diff | Splinter Review |
Probably a regression from the Bugzilla->user changes we made for logged out
users. Basically, viewing a bug while logged out is getting me:
Can't call method "can_see_bug" on an undefined value at Bugzilla/Bug.pm line 159.
I think that's a bit weird to say the least, but my tree has no mods and it's
showing up like that. I have a band-aid but I'm not committing to it yet.
Reporter | ||
Comment 1•20 years ago
|
||
I'm not taking this, just suggesting a fix. Is it okay to use Bugzilla there? I
don't know..
Reporter | ||
Updated•20 years ago
|
Assignee | ||
Comment 2•20 years ago
|
||
ugh! why were they creating a new object there?
That looks like the right fix. I dont see any reason not to call
Buigzilla->user from Bug.pm. Why not?
Assignee | ||
Comment 3•20 years ago
|
||
It is kind of silly to create a "userid=0" user, but let's fix this in User.pm
so we dont have to worry about other wacky places.
Assignee | ||
Updated•20 years ago
|
Attachment #155267 -
Attachment is obsolete: true
Assignee | ||
Updated•20 years ago
|
Attachment #155288 -
Flags: review?(kiko)
Assignee | ||
Comment 4•20 years ago
|
||
We should fix all the code that play the userid=0 ==> logged out card and update
it. But, that should be a different bug.
Assignee | ||
Updated•20 years ago
|
Attachment #155288 -
Flags: review?(justdave)
Reporter | ||
Comment 5•20 years ago
|
||
Can you at least do a mini-audit and see where else we create new objects to
ensure there are no time bombs like this left over?
Status: NEW → ASSIGNED
Assignee | ||
Comment 6•20 years ago
|
||
There are a bunch of places that pass userid to the constructor. It is hard to
say if any of them play the zero trick, but this fix completes the emulation of
that so we should be ok.
The only other direct calls into Bugzilla::User are for the wildcard match and
it takes care of going through Bugzilla->user already.
Reporter | ||
Comment 7•20 years ago
|
||
Comment on attachment 155288 [details] [diff] [review]
Fix - new with userid zero returns logged out user
Ah, so the problem is that return undef? Can you add a comment explaining that
if you pass in a bogus/nonexistant ID we bail out with undef?
Also add a comment there explaining that we return a dead user in this
situation so people can track this down easily.
I'm not sure why that callsite creates a new user either, but maybe
Bugzilla::Bug can't depend on Bugzilla.pm?
Attachment #155288 -
Flags: review?(kiko) → review+
Updated•20 years ago
|
Flags: approval?
Updated•20 years ago
|
Flags: approval? → approval+
Assignee | ||
Comment 8•20 years ago
|
||
checked in
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•20 years ago
|
Attachment #155288 -
Flags: review?(justdave)
Updated•12 years ago
|
QA Contact: matty_is_a_geek → default-qa
You need to log in
before you can comment on or make changes to this bug.
Description
•