Closed Bug 104180 Opened 23 years ago Closed 23 years ago

preset query footer broken for named queries containing spaces

Categories

(Bugzilla :: User Interface, defect)

2.15
x86
Windows 98
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.16

People

(Reporter: mattdm, Assigned: kiko)

Details

(Keywords: regression)

Attachments

(1 file)

Doesn't happen at bugzilla.mozilla.org, but does with a just-tonight cvs update.
Spaces in the urls of preset queries displayed in the footer are getting changed
to &nbsp instead of %20, causing the links to break.
Taking the liberty of reassigning to justdave, as it seems to be his change
(line 1400 in CGI.pl) that causes this. :)
Assignee: myk → justdave
This is my fault, too. Sorry, HTML compliance fixes. Okay, let me put you up to
the decision:

Originally, we used <NOBR> to wrapped around the bug name. This worked fine, but
simply wasn't HTML compliant. To change this, there are two options (that I can
see):

a) Make space-separated names breakable, meaning they can wrap.
b) Substitute space for &nbsp;

I chose the second option, but didn't realize the problem it would cause in the
receiving end. To fix that, you can apply this fix:

--- buglist.cgi 2001/10/05 22:20:33 1.144
+++ buglist.cgi 2001/10/11 19:06:51
@@ -816,7 +816,9 @@

 CMD: for ($::FORM{'cmdtype'}) {
     /^runnamed$/ && do {
-        $::buffer = LookupNamedQuery($::FORM{"namedcmd"});
+        my $namedcmd = $::FORM{"namedcmd"};
+        $namedcmd =~ s/&nbsp;/ /g;
+        $::buffer = LookupNamedQuery($namedcmd);
         $::querytitle = "Bug List: $::FORM{'namedcmd'}";
         ProcessFormFields($::buffer);
         last CMD;



But I am unsure this is the correct fix. I can remove the &nbsp;-ifying if we
decide it's the best (I will _not_ break HTML compliance, however, so NOBR is
out of the question).
Assignee: justdave → kiko
Keywords: patch, regression, review
What not just do this?

Index: CGI.pl
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/CGI.pl,v
retrieving revision 1.109
diff -u -r1.109 CGI.pl
--- CGI.pl      2001/10/11 19:07:00     1.109
+++ CGI.pl      2001/10/11 19:19:26
@@ -1395,11 +1395,12 @@
         my $anynamedqueries = 0;
         while (MoreSQLData()) {
             my ($name) = (FetchSQLData());
+            my $disp_name = $name;
             if ($anynamedqueries || $mybugslink) { $html .= " | " }
             $anynamedqueries = 1;
-            $name =~ s/ /&nbsp;/g;
+            $disp_name =~ s/ /&nbsp;/g;
             $html .= "<A HREF=\"buglist.cgi?cmdtype=runnamed&amp;namedcmd=" .
-                     url_quote($name) . "\">$name</A>\n";
+                     url_quote($name) . "\">$disp_name</A>\n";
         }
         $html .= "</TD></TR>\n";
     } else {
whoop; collision. I was suggesting basically the same thing:

--- CGI.pl.orig Thu Oct 11 15:21:01 2001
+++ CGI.pl      Thu Oct 11 15:30:40 2001
@@ -1397,9 +1397,9 @@
             my ($name) = (FetchSQLData());
             if ($anynamedqueries || $mybugslink) { $html .= " | " }
             $anynamedqueries = 1;
-            $name =~ s/ /&nbsp;/g;
+            (my $nbspname = $name) =~ s/ /&nbsp;/g;
             $html .= "<A HREF=\"buglist.cgi?cmdtype=runnamed&amp;namedcmd=" .
-                     url_quote($name) . "\">$name</A>\n";
+                     url_quote($name) . "\">$nbspname</A>\n";
         }
         $html .= "</TD></TR>\n";
     } else {
Comment on attachment 53132 [details] [diff] [review]
kiko_v1: stop being stupid about   and HREF

3 patches that essentially do the same thing :)
r=jake (once removing the last portion)
Attachment #53132 - Attachment description: kiko_v1: stop being stupid about &nbsp and HREF → kiko_v1: stop being stupid about and HREF
Attachment #53132 - Flags: review+
/cvsroot/mozilla/webtools/bugzilla/CGI.pl,v  <--  CGI.pl
new revision: 1.110; previous revision: 1.109
done

Thanks to all involved :)
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Target Milestone: --- → Bugzilla 2.16
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

Creator:
Created:
Updated:
Size: