Closed Bug 166698 Opened 22 years ago Closed 22 years ago

The error system's in a bit of a mess

Categories

(Bugzilla :: Bugzilla-General, defect)

2.15
defect
Not set
blocker

Tracking

()

RESOLVED FIXED
Bugzilla 2.18

People

(Reporter: gerv, Assigned: gerv)

Details

Attachments

(1 file, 1 obsolete file)

As bbaetz points out, things have gone a bit wrong. We've got quite a few things
in the wrong place. This bug is to record my efforts to fix this.

Gerv
We need this fixed RSN.... :)
Severity: normal → blocker
Target Milestone: --- → Bugzilla 2.18
Attached patch Patch v.1 (obsolete) — Splinter Review
Here's the first patch. It does the following:

- Removes an old, incorrect comment in CGI.pl
- Adds useful localisation instructions to code-error.html.tmpl and CGI.pl
- Changes one error in page.cgi to use proper errors rather than messages
- Moves a large number of errors from messages.html.tmpl to
user-error.html.tmpl, where they belong
- Rearranges both those files so the errors/messages are in alphabetical order
- fix incorrect comment and bug in code-error.html.tmpl

Gerv
Comment on attachment 97861 [details] [diff] [review]
Patch v.1

>Index: CGI.pl
>===================================================================
>RCS file: /cvsroot/mozilla/webtools/bugzilla/CGI.pl,v
>retrieving revision 1.174
>diff -u -r1.174 CGI.pl
>--- CGI.pl	31 Aug 2002 01:53:12 -0000	1.174
>+++ CGI.pl	4 Sep 2002 23:29:29 -0000

>@@ -892,7 +888,11 @@
>         my $maintainer = Param('maintainer');
>         my $error = html_quote($vars->{'template_error_msg'});
>         my $error2 = html_quote($template->error());
>+
>+        # You may wish to localise this message. If you do so, only localise
>+        # the text from here to the second END.

How can someone localise this? I think that by the time we get here, its all
over....

<snip messages stuff>

Can you please describe, in plain english, why messagesmust go in one file
rather than another? Then document that somewhere.....
> How can someone localise this? I think that by the time we get here, its all
> over....

Someone can localise it by editing CGI.pl. What I'm saying is that localisers
may want to do this even though it's editing a CGI. Do you think making this
suggestion is, in fact, dangerous?

> Can you please describe, in plain english, why messagesmust go in one file
> rather than another? Then document that somewhere.....

Sure. The new scheme is much more simple:
If you are calling ThrowUserError, put it in user-error.html.tmpl
If you are calling ThrowCodeError, put it in code-error.html.tmpl
If you are using a message (either via message.html.tmpl or header.html.tmpl)
put it in messages.html.tmpl .

Simple and obvious. Wahey :-) I plan to post to the newsgroups about this again
when this patch goes in and, in the long term, it'll go in the Developers Guide.

Gerv


Comment on attachment 97861 [details] [diff] [review]
Patch v.1

I thought that that was what the idea was all along....

I'm not convinced that the last-ditch error message localisation is a good
idea. OTOH, it won't hurt anything, so...

r=bbaetz x2, although I didn't check that all of the errors were copied
exactly.
Attachment #97861 - Flags: review+
Attached patch Patch v.2Splinter Review
The actually-checked-in patch, without the localisation comments. bbaetz is
right - they are silly.

Gerv
Attachment #97861 - Attachment is obsolete: true
Fixed.

Checking in CGI.pl;
/cvsroot/mozilla/webtools/bugzilla/CGI.pl,v  <--  CGI.pl
new revision: 1.175; previous revision: 1.174
done
Checking in page.cgi;
/cvsroot/mozilla/webtools/bugzilla/page.cgi,v  <--  page.cgi
new revision: 1.4; previous revision: 1.3
done
Checking in template/en/default/global/messages.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/global/messages.html.tmpl,v
 <--  messages.html.tmpl
new revision: 1.7; previous revision: 1.6
done
Checking in template/en/default/global/user-error.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl,v
 <--  user-error.html.tmpl
new revision: 1.6; previous revision: 1.5
done
Checking in template/en/default/global/code-error.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/global/code-error.html.tmpl,v
 <--  code-error.html.tmpl
new revision: 1.9; previous revision: 1.8
done

Gerv
Status: NEW → RESOLVED
Closed: 22 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.

Attachment

General

Created:
Updated:
Size: