Closed Bug 109054 Opened 23 years ago Closed 22 years ago

If auth fails on create new attachment, no Bugzilla header is displayed

Categories

(Bugzilla :: Attachments & Requests, defect, P1)

2.15

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: caillon, Assigned: myk)

Details

Go to a create new attachment page and turn off cookies and try to upload an
attachment.  See also bug 109048.

You get a yucky text/plain message that says this and only this:

The name <TT></TT> is not a valid username.  Either you
misspelled it, or the person has not registered for a
Bugzilla account.
<P>Please hit the <B>Back</B> button and try again.
Dupe of bug 109048, it looks like.

*** This bug has been marked as a duplicate of 109048 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
Re-opening.  Bug 109048 (which I'm aware of) is about WHY that happens.  The
reporter of that bug got that page because something screwed up, either no
cookies or something. 

This is about what happens after 109048 happens.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Priority: -- → P1
Target Milestone: --- → Bugzilla 2.16
This is hard to fix. 

sub DBNameToIdAndCheck() does not know whether the HTML headers are started, or
finished, or midway through when it is called, which makes error reporting
difficult. To date, it has always added an extra \n to finish the headers, but
that means you can't use a canned error function like DisplayError() - because
if the headers weren't started (as in this case), then there are no headers and
the HTML from DisplayError (which generates its own header) gets displayed as
plain text.
<sigh>.

Gerv
ping...
I can't reproduce this.  Reporter, can you try on the tip and see if it still
happens?
Assignee, no I can't reproduce this on the tip.  This got masked by the fix for
bug 109048.

What this bug is about is that in certain situations (back out bug 109048 for
the example mentioned in this bug), you get a text/plain message as outlined in
comment #0 that is not informative at all.  See sub DBNameToIdAndCheck() @
http://lxr.mozilla.org/mozilla/source/webtools/bugzilla/globals.pl#943

If we enter the else loop there, and no Bugzilla headers stuff have been sent to
the browser yet, we just get everything in plain text.  In Moz that means the
HTML is shown.  Furthermore, if $name is an empty string, then "The name
<TT></TT>" ... is not at all useful.  So when we enter that code, we need to
send headers if they've been displayed already, or only call that function after
headers are displayed (and send the footer as well) and check to see if $name
has been supplied.  If not, it doesn't make sense to display the message we
currently do.  A different message (or a more generic one for all cases) is
preferred.
Since the only way we know how to reproduce this is getting masked at the
moment, so you won't really see this that often, I'm pushing this off.  We have
bigger things to worry about for 2.16.  If this happens to get fixed by the
templatization, set dependencies appropriately and move it back.
Target Milestone: Bugzilla 2.16 → Bugzilla 2.18
This should have been fixed during 2.16 templatisation, so moving there so
someone can test it.
Target Milestone: Bugzilla 2.18 → Bugzilla 2.16
DBNameToIDAndCheck now uses a proper error reporting function.

Gerv
Status: REOPENED → RESOLVED
Closed: 23 years ago22 years ago
Resolution: --- → WORKSFORME
clearing target milestone on invalid/duplicate/worksforme/wontfix bugs so
they'll show up as untriaged if they get reopened.
Target Milestone: Bugzilla 2.16 → ---
Component: Creating/Changing Bugs → attachment and request management
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.