Closed Bug 138284 Opened 22 years ago Closed 22 years ago

Tweak Bugzilla to prepare for simple enter bug template

Categories

(Bugzilla :: Bugzilla-General, defect)

2.15
x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.16

People

(Reporter: gerv, Assigned: gerv)

Details

Attachments

(1 file, 2 obsolete files)

Over in bug 133559, I'm developing a second template for enter_bug.cgi - the
Bugzilla Helper is becoming a template.


Bugzilla needs a tweak or two to support the extra stuff. It is likely that
b.m.o will update to 2.16, and stay there. Therefore, to get this on b.m.o,
they'll have to apply the patch by hand. So, it would be ideal if these tweaks
were part of Bugzilla 2.16, even if the new template isn't.

The tweaks are:
- setting the variable user_agent to the user-agent string when we initialise
$vars. This is generally useful.
- choose-product.tmpl passing the format parameter through to its target.
- the simple buglist format saying "Zarro Boogs", instead of nothing, if no bugs
are found.

I have simple patches for all of these, but want to discuss whether any of them
are controversial first :-)

Gerv
Accepting; targetting at 2.16.

Gerv
Status: NEW → ASSIGNED
Target Milestone: --- → Bugzilla 2.16
Version: 2.10 → 2.15
Another change would be to make duplicates.cgi take a "simple" parameter as
well, and split the template up into components. I don't know if we'll get that
for 2.16, though.

Gerv
Attached patch Patch v.1 (obsolete) — Splinter Review
Here's v.1 - it patches the wrong templates, but it gives an idea of what I'm
trying to do.

Gerv
Keywords: patch, review
Attached patch Patch v.2 (obsolete) — Splinter Review
This patch patches the correct templates. Ready for review.

Gerv
Attachment #80311 - Attachment is obsolete: true
Comment on attachment 80682 [details] [diff] [review]
Patch v.2

>Index: enter_bug.cgi

>-$vars->{'component_'} = $::components{$product};
>+$vars->{'component_'} = \@components;

Why fetch them from the database instead of the version cache?


>+my $template_name = "bug/create/create";
>+$template_name .= $::FORM{'format'} ? "-$::FORM{'format'}" : "";

This should use ValidateOutputFormat.


>Index: globals.pl

>+    # User Agent
>+    'user_agent' => $ENV{'HTTP_USER_AGENT'} ,

I'm not sure this is so generally useful that it warrants being in
globals.pl instead of enter_bug.cgi.  On the other hand, I'm not sure
it isn't either, so although I have misgivings, I guess this is ok.
Attachment #80682 - Flags: review-
Attached patch Patch v.2Splinter Review
> >-$vars->{'component_'} = $::components{$product};
> >+$vars->{'component_'} = \@components;
> 
> Why fetch them from the database instead of the version cache?

The version cache doesn't have the descriptions in it. the @components array is
an array of hashes, with members 'name' and 'description', generated further up
the patch.

> >+my $template_name = "bug/create/create";
> >+$template_name .= $::FORM{'format'} ? "-$::FORM{'format'}" : "";
> 
> This should use ValidateOutputFormat.

OK.

> >+	# User Agent
> >+	'user_agent' => $ENV{'HTTP_USER_AGENT'} ,

> I'm not sure this is so generally useful that it warrants being in
> globals.pl instead of enter_bug.cgi.	On the other hand, I'm not sure
> it isn't either, so although I have misgivings, I guess this is ok.

I think it's a good utility one; who knows what sort of templates localisers
might want to produce? And, like it or not, the user agent is still the
standard way to tell browsers apart.

Gerv
Attachment #80682 - Attachment is obsolete: true
>The version cache doesn't have the descriptions in it. the @components array is
>an array of hashes, with members 'name' and 'description', generated further up
>the patch.

Where c.description used?  I don't see it anywhere in this patch.
> Where c.description used?  I don't see it anywhere in this patch.

It's not, in this patch :-) 

I have a nifty feature on the Bugzilla Helper replacement where (if you have JS
enabled) when you select a component, its description appears next to the select
widget. Hence the need to have the descriptions on the interface, and so the
need to switch from a list to a 2-member hash.

Gerv

Comment on attachment 80865 [details] [diff] [review]
Patch v.2

Aah, I see.  Ok, then, r=myk
Attachment #80865 - Flags: review+
Comment on attachment 80865 [details] [diff] [review]
Patch v.2

>diff -u -r1.4 choose-product.html.tmpl
>--- template/en/default/global/choose-product.html.tmpl	24 Apr 2002 18:27:38 -0000	1.4
>+++ template/en/default/global/choose-product.html.tmpl	24 Apr 2002 22:41:17 -0000
>@@ -27,8 +27,9 @@
> [% FOREACH p = proddesc.keys.sort %]
>   <tr>
>     <th align="right" valign="top">
>-      <a href="[% target %]?product=[% p FILTER url_quote %]">
>-        [% p FILTER html %]</a>:
>+      <a href="[% target %]?product=[% p FILTER url_quote %]
>+                                           [%- "&format=$format" IF format %]">

[%- "&amp;format=$format" IF format %]">, rather

>RCS file: /cvsroot/mozilla/webtools/bugzilla/template/en/default/list/list-simple.html.tmpl,v
>retrieving revision 1.2
>diff -u -r1.2 list-simple.html.tmpl
>--- template/en/default/list/list-simple.html.tmpl	19 Apr 2002 22:37:54 -0000	1.2
>+++ template/en/default/list/list-simple.html.tmpl	24 Apr 2002 22:41:17 -0000
>@@ -39,7 +39,11 @@
>   </head>
> 
>   <body>
>-    [% PROCESS list/table.html.tmpl %]
>+    [% IF bugs.size == 0 %]
>+      <h3>Zarro Boogs found.</h3>
>+    [% ELSE %]
>+      [% PROCESS list/table.html.tmpl %]
>+    [% END %]
>   </body>
> 
> </html>

Its probably a good idea, though.

r=bbaetz with the above change
Attachment #80865 - Flags: review+
Fixed.

Checking in enter_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/enter_bug.cgi,v  <--  enter_bug.cgi
new revision: 1.66; previous revision: 1.65
done
Checking in globals.pl;
/cvsroot/mozilla/webtools/bugzilla/globals.pl,v  <--  globals.pl
new revision: 1.163; previous revision: 1.162
done
Checking in template/en/default/bug/create/create.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/create/create.html.tmpl,v
 <--  create.html.tmpl
new revision: 1.5; previous revision: 1.4
done
Checking in template/en/default/global/choose-product.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/global/choose-product.html.tmpl,v
 <--  choose-product.html.tmpl
new revision: 1.5; previous revision: 1.4
done
Checking in template/en/default/list/list-simple.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/list/list-simple.html.tmpl,v
 <--  list-simple.html.tmpl
new revision: 1.3; previous revision: 1.2
done

Gerv
Status: ASSIGNED → 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: