query.cgi javascript does not work on netscape 4.04 and 4.05

VERIFIED FIXED in Bugzilla old

Status

()

Bugzilla
Bugzilla-General
P3
minor
VERIFIED FIXED
19 years ago
5 years ago

People

(Reporter: Jay Ball, Assigned: Terry Weissman)

Tracking

unspecified
Bugzilla old

Details

(Reporter)

Description

19 years ago
with netscape 4.04 and 4.05, the javascript selection does not work.  when you
click on a program, the version column is updated, but the component column only
displays the first correct entry and then a javascript error occurs.

i am reporting this error second hand from my users.  i saw and experienced the
errors myself, but my users decided to immediately upgrade to netscape 4.51
before i could get the exact text (blasted users!)  the error mentions something
like "bla is undefined".

could someone please verify this with v4.04 and v4.05?
(Assignee)

Comment 1

19 years ago
Reassigning to dmose@mozilla.org, who now has front-line responsibility for
all Bonsai and Bugzilla bugs.
(Assignee)

Comment 2

19 years ago
Reassigning back to me.  That stuff about me no longer being the front-line
person responsible for Bugzilla and Bonsai turned out to be short-lived.
Please pardon our confusion, and I'm very sorry about the spam.

Comment 3

19 years ago
this patch fixes (or works around) the problem:

diff -r1.33 query.cgi
245a246,253
>     // Netscape 4.04 and 4.05 also choke with an "undefined"
>     // error.  if someone can figure out how to "define" the
>     // whatever, we'll remove this hack.  in the mean time, we'll
>     // assume that v4.00-4.03 also die, so we'll disable the neat
>     // javascript stuff for Netscape 4.05 and earlier.
>     var agtver = parseFloat(navigator.appVersion);
>     if (agtver <= 4.05 ) return;
>
(Assignee)

Comment 4

19 years ago
*** Bug 6230 has been marked as a duplicate of this bug. ***

Comment 5

19 years ago
This seems to happen with NN3.04/NT4 too, except that the component list does
not change at all and the error message is slightly different: "selectProduct is
not defined".

On IE4.0/NT4 there is no error message, but again, the component list does not
change at all.
(Assignee)

Comment 6

19 years ago
OK, I have applied the above patch.
(Assignee)

Updated

18 years ago
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
(Assignee)

Comment 7

18 years ago
I'm trusting that applying the above patch fixed this bug.

Comment 8

18 years ago
Hi, I'm using NS3.0 (my favourite ;), because it's fast and small.
I have found possibly related bug-id's (listed in brackets) for the
following two problems. I'm a little bit lazy, so i only post this text
here:

----------
1. problem with push-function in JavaScript-part created by query.cgi:
   (Bug #6230, #5249, #4133, #4106, #21381)

   JavaScript1.1 support the prototype-statement for objects, but if
   you loop through your objects 'cpts' or 'vers' (for (c in cpts) ...),
   you will also get the 'push'-string (remember the setting of the
   push-function with the 'Array.prototype'-call) as value for 'c'.

   But  cpts['push']  is of kind 'function', not an (array-)object,
   so you will get an error "Object doesnt' support this property or method"
   (as Bug #4133), when accessing it: 'for (j in cpts[c]) ...'

   In JavaScript1.2 this works fine. No error. But you loose the
   availability for browser < V4 and get errors when you've set the
   language-attribute of the script-tag to JS1.2.  :(

----------
2. problem with selectProduct-function created by query.cgi:
   (Bug #6230, #5249, #22269, #21381)

   I don't understand, why anybody put JavaScript-functions within the body
   of a html-page and not to the header. sigh.

   Anyway, in the comments for Bug #22269, 'dave@intrec.com' mentioned the
   main-cause for not including javascript-code in the body-tag; because when
   the browser wants to execute the onload-functions, it can't find them.

   But there's an easy solution. We must simple define the used functions,
   BEFORE they are referenced (see below).


--------------------
So, I suggest two changes:

for 1: push-problem (sorry, only know how to 'cvs diff -u'):

*** update 'query.cgi' ***
============================ allow JS1.1
@@ -200,3 +200,3 @@
 my $jscript = << 'ENDSCRIPT';
-<script language="Javascript1.2" type="text/javascript">
+<script language="Javascript1.1" type="text/javascript">
============================ don't check for Browser-type
@@ -257,3 +257,3 @@
     var agtver = parseFloat(navigator.appVersion);
-    if (agtver <= 4.05 ) return;
+    // if (agtver <= 4.05 ) return;
============================ check for 'function'-type in array-object ...
@@ -279,2 +279,3 @@
     for (c in cpts) {
+        if (typeof(cpts[c]) == 'function') continue;
============================
@@ -284,2 +285,3 @@
                 for (j in cpts[c]) {
+                    if (typeof(cpts[c][j]) == 'function') continue;
============================
@@ -311,2 +313,3 @@
     for (v in vers) {
+        if (typeof(vers[v]) == 'function') continue;
============================
@@ -316,2 +319,3 @@
                 for (j in vers[v]) {
+                    if (typeof(vers[v][j]) == 'function') continue;
============================

  Instead of using the check 'if (typeof(..) == 'function') continue;', you
  can use 'if (typeof(..) != 'object') continue;', if you like.

  I can't test it for IE or NS4.04/4.05, maybe you have the possibility to
  do this(?).


--------------------
for 2: selectProduct-problem:

*** update 'query.cgi' ***
============================ Print JavaScript in header (within head-tag)
@@ -355,3 +359,4 @@
 PutHeader("Bugzilla Query Page", "Query Page", "",
-          q{onLoad="selectProduct(document.forms[0]);"});
+          q{onLoad="selectProduct(document.forms[0]);"},
+          $jscript);
============================
@@ -359,4 +364,2 @@
 push @::legal_target_milestone, "---"; # Oy, what a hack.
-
-print $jscript;
============================

*** update 'CGI.pl' ***
============================ Print JavaScript in header (within head-tag)
@@ -490,3 +490,3 @@
 sub PutHeader {
-    my ($title, $h1, $h2, $extra) = (@_);
+    my ($title, $h1, $h2, $extra, $jscript) = (@_);
============================
@@ -503,3 +503,3 @@
     print "<HTML><HEAD>\n<TITLE>$title</TITLE>\n";
-    print Param("headerhtml") . "\n</HEAD>\n";
+    print Param("headerhtml") . "\n${jscript}\n</HEAD>\n";
============================


Maybe the other bug-id's are solved too, maybe not.

Ciao, Greetings by JUG :)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Comment 9

18 years ago
additionally change the following to avoid perl-warnings of unset-var:
===========================
@@ -490,3 +490,4 @@
 sub PutHeader {
     my ($title, $h1, $h2, $extra, $jscript) = (@_);
+    $jscript ||= '';
===========================
(Assignee)

Comment 10

18 years ago
OK, I have applied these patches.  Thanks!
Status: REOPENED → RESOLVED
Last Resolved: 18 years ago18 years ago
Resolution: --- → FIXED
per Terry, auto-verifying any resolved bug that hasn't been touched since before 
2.10 was released.
Status: RESOLVED → VERIFIED
Moving to Bugzilla product
Component: Bugzilla → Bugzilla-General
Product: Webtools → Bugzilla
QA Contact: matty
Target Milestone: --- → Bugzilla old
Version: other → unspecified
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.