Closed
Bug 58436
Opened 25 years ago
Closed 24 years ago
javascript strict warnings in query.cgi
Categories
(Bugzilla :: Query/Bug List, defect, P3)
Tracking
()
VERIFIED
FIXED
Bugzilla 2.16
People
(Reporter: bugzilla, Assigned: kiko)
References
()
Details
Attachments
(8 files)
|
2.63 KB,
patch
|
Details | Diff | Splinter Review | |
|
2.84 KB,
patch
|
Details | Diff | Splinter Review | |
|
3.00 KB,
patch
|
Details | Diff | Splinter Review | |
|
512 bytes,
patch
|
Details | Diff | Splinter Review | |
|
1.18 KB,
patch
|
Details | Diff | Splinter Review | |
|
1.46 KB,
patch
|
Details | Diff | Splinter Review | |
|
1.98 KB,
patch
|
Details | Diff | Splinter Review | |
|
2.63 KB,
patch
|
caillon
:
review+
jacob
:
review+
|
Details | Diff | Splinter Review |
The javascript output from query.cgi has a lot of javascript script warnings.
Some of them:
JavaScript strict warning:
http://bugzilla.mozilla.org/query.cgi line 783: reference to undefined property
vsel[v]
JavaScript strict warning:
http://bugzilla.mozilla.org/query.cgi line 817: reference to undefined property
tmsel[tm]
Expected:
No javascript strict warnings...
| Reporter | ||
Comment 1•25 years ago
|
||
| Reporter | ||
Updated•25 years ago
|
Comment 2•25 years ago
|
||
My javascript console is not complaining. What browser are you using?
Status: NEW → ASSIGNED
| Reporter | ||
Comment 3•25 years ago
|
||
Mozilla with:
user_pref("javascript.options.strict", true);
| Reporter | ||
Updated•24 years ago
|
Summary: Lots of strict warnings in query.cgi → javascript strict warnings in query.cgi
| Reporter | ||
Comment 4•24 years ago
|
||
what are the chances that the patch is checked in?
| Reporter | ||
Comment 5•24 years ago
|
||
please: someone review and checkin!
Could someone please explain what I need to do, for something like this getting
checked in? I hate creating patches that doesn't get used.
Comment 6•24 years ago
|
||
Anyone else out there with CVS access to Bugzilla?
Assignee: tara → cyeh
Status: ASSIGNED → NEW
Comment 7•24 years ago
|
||
If there is no response, you can post to n.p.m.webtools.
Comment 8•24 years ago
|
||
Gerv, do you know the official way to get a review for a bugzilla patch?
Comment 9•24 years ago
|
||
These are all bugzilla people I'm aware of. Are there more?
Comment 10•24 years ago
|
||
I'm not a JavaScript expert, but what I see changed in this patch makes sense to
me (I've had to do similar things in Perl to avoid dealing with undefined
variables).
Comment 11•24 years ago
|
||
I suppose I should clarify... I'm willing to check it in if we get a couple more
people who are more familiar with JavaScript that will vouch for it not breaking
anything. Having it tried out with a variety of browsers on someone's system
will be a plus.
Comment 12•24 years ago
|
||
Looking at it, it seems very unlikely indeed to break anything... but it should
go on Landfill first.
Gerv
Comment 13•24 years ago
|
||
Bug 61110 looks like a duplicate of this one. It also has a patch, and the
patches are not identical...
Comment 14•24 years ago
|
||
Strike that last comment. 61110 is indeed the same bug, but it's for tinderbox,
not Bugzilla. :-) similar patch, but for a different program.
Comment 15•24 years ago
|
||
I posted this patch on nuevaschool.org/cgi-bin/zach/bugzilla/index.cgi (you
must use .cgi, not .html for it to work) since landfill is messed up and
afranke@ags.uni-sb.de asked me to. I'll look at this in a bit and see what I
get.
Comment 16•24 years ago
|
||
The patch is up and it works fine, but I don't seem to notice the difference.
I turned on the pref in my pref file, but I don't get the error with the
bugzilla.mozilla.org version either.
Comment 17•24 years ago
|
||
Sorry for the problem. I had to clbr my install, I reposted this patch now.
| Reporter | ||
Comment 18•24 years ago
|
||
what's the status here?
Comment 19•24 years ago
|
||
Putting it on Tara's 2.12 radar might produce some traction...
Gerv
Whiteboard: 2.12
Comment 20•24 years ago
|
||
Alright, finally saw this (thanks for the heads up Gerv).
I still get one warning, which is:
reference to undefined property f.target_milestone
line 121
To be honest after a preliminary inspection of the code I'm not sure why it's
bitching about this (especially at that line number), but I'm willing to either
wait for you to have a look or take it as is with all the other warnings removed.
Status: NEW → ASSIGNED
| Reporter | ||
Comment 21•24 years ago
|
||
I'm trying to fix this, so wait a day and I'll post a patch that works...
Is there a place, with a newer query.cgi, where this patch has been applied?
just to make sure that all js warnings go away....:)
| Reporter | ||
Comment 22•24 years ago
|
||
Comment 23•24 years ago
|
||
I've got an up to date install that unfortunately is not publically available
yet, but I'll let you know what I find. (Thanks for all your help, by the way)
Comment 24•24 years ago
|
||
All good. Thanks again.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 25•24 years ago
|
||
this one hasn't been checked in yet, right?
Comment 26•24 years ago
|
||
It seems that part of this bugfix is causing errors in Netscape 4.7 (for
dave@intrec.com,Mac OS 9.1) and IE 5 (for me, Win2k). It seems to be:
- if (f.target_milestone) {
+ if ("target_milestone" in f) {
As changing that line back to f.target_milestone makes the errors go away.
Please note that these aren't strict warnings being seen, they are full-fledged
"this script won't run" type errors. I think for the time being it'd be better
to change this particular line back to it's pre-fix state and then see what can
be done about the strict warnings later.
Updated•24 years ago
|
Updated•24 years ago
|
Comment 27•24 years ago
|
||
It looks like it's in the trunk. I'm trying to find IE 5/Win2K to test with.
Comment 28•24 years ago
|
||
Grrr. I don't have access to a Win2K machine so I can't test that changing the
line back to f.targetmilestone works. Can I get a witness from the congregation
so this fix can be checked in?
Comment 29•24 years ago
|
||
I know changing it back to f.target_milestone makes the script errors in IE on
Win2k go away... and Dave said in IRC that it worked for him w/NS on the Mac. I
don't know how this effects the strict warnings in Mozilla (as I've never used
the JavaScript console).
Status: REOPENED → RESOLVED
Closed: 24 years ago → 24 years ago
Resolution: --- → FIXED
Comment 30•24 years ago
|
||
changed to f.target_milestone
Comment 31•24 years ago
|
||
I'm running into problems with this using IE 5.0 on Win NT. The if
("target_milestone" in f) syntax isn't accepted, as has been pointed out. But
the if (f.target_milestone) leads to a different script error if target
milestones are disabled in the project. That was what bug #39044 was about and
why the conditional was added in the first place. But I don't see a syntax that
allows this in IE JScript.
The change that works on my system is to split the javascript text into three
parts and only conditionally add the section referring to target_milestone by
putting it inside of
if (Param("usetargetmilestone")) {
$jscript .= q{
if (f.target_milestone) {
...
}
}
If someone knows a way that IE JScript can test for existence of an element of
an object that doesn't error out when the element is not defined, you can use
that instead.
Comment 32•24 years ago
|
||
Reopening bug, still breaks on IE 5.0
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 33•24 years ago
|
||
Comment 34•24 years ago
|
||
Can someone please apply this patch and test it with IE 5.0, I.E 5.5,
Communicator 4.5 or greater, and Mozilla .8?
Comment 35•24 years ago
|
||
It still doesn't work in IE 5.0 under Windows NT. Notice that in my last
comment I showed the if Param("usetargetmilestone") being followed by a
$jscript .= q{ line. The Param test is in Perl, not in the JScript, and I meant
to show the JScript being split into three parts so none of the
target_milestone stuff even appears on the web page if target_milestones are
turned off in the preferences.
Note that the test case for this is when you turn off use of target milestones
in the preferences.
If nobody gets to this before I can in a few hours I'll submit a patch that
shows it all exactly.
Comment 36•24 years ago
|
||
You're right, I don't even know what I was thinking when I did that.
Comment 37•24 years ago
|
||
Comment 38•24 years ago
|
||
Ok, I've tried my patch with IE 5.0 under WinNT and Netscape 4.76 in Linux,
with use target milestones both on and off in the project preferences.
Comment 39•24 years ago
|
||
moving to real milestones...
Whiteboard: 2.12
Target Milestone: --- → Bugzilla 2.12
Comment 40•24 years ago
|
||
patch verified and checked into trunk
Status: REOPENED → RESOLVED
Closed: 24 years ago → 24 years ago
Resolution: --- → FIXED
Comment 41•24 years ago
|
||
VERIFIED no strict warnings from query.cgi. Loads from quicksearch.js, though...
bug 71503 opened.
Gerv
Status: RESOLVED → VERIFIED
Comment 42•24 years ago
|
||
*** Bug 73877 has been marked as a duplicate of this bug. ***
Comment 43•24 years ago
|
||
*** Bug 75526 has been marked as a duplicate of this bug. ***
| Reporter | ||
Comment 44•24 years ago
|
||
has this been put into http://bugzilla.mozilla.org/query.cgi ?
Comment 45•24 years ago
|
||
gemal@gemal.dk: Yes. Although JavaScript has changed again since this was added
due to bug 72379.
| Reporter | ||
Comment 46•24 years ago
|
||
console is again flooded when going to http://bugzilla.mozilla.org/query.cgi
Updated•24 years ago
|
Target Milestone: Bugzilla 2.12 → Bugzilla 2.16
| Reporter | ||
Comment 47•24 years ago
|
||
if you're running with strict js warns on mozilla becomes unavailable because
of *all* the warnings the query.cgi javascript:
Warning: reference to undefined property tmsel[tm]
Source File: http://bugzilla.mozilla.org/query.cgi
Line: 915
| Reporter | ||
Comment 48•24 years ago
|
||
| Reporter | ||
Updated•24 years ago
|
| Reporter | ||
Comment 49•24 years ago
|
||
any chance for a checkin????
Comment 50•24 years ago
|
||
checkins are frozen for the 2.14 release. As soon as 2.14 ships we'll be making
an effort to get all the patches that are sitting around fixed up and checked in.
Comment 51•24 years ago
|
||
This is not a strict warning, but an error that I get with win32 2001071104
build after loading http://bugzilla.mozilla.org
Error: f.product has no properties
Source File: http://bugzilla.mozilla.org/query.cgi
Line: 830
| Reporter | ||
Comment 52•24 years ago
|
||
The real multiplatform multibrowser solution to the:
("target_milestone" in f)
ala checks seems to be:
(typeof(f.target_milestone) != 'undefined')
works in IE5.5, IE5.0, Mozilla and Netscape 4
| Reporter | ||
Comment 53•24 years ago
|
||
Comment 54•24 years ago
|
||
Taking all of cyeh's Bugzilla bugs.
Assignee: Chris.Yeh → justdave
Status: REOPENED → NEW
Comment 55•24 years ago
|
||
Mass moving to new product Bugzilla...
Assignee: justdave → endico
Component: Bugzilla → Query/Bug List
Product: Webtools → Bugzilla
Version: other → 2.13
Comment 56•24 years ago
|
||
After recent query.cgi JavasScript changes (see bug 96534), the only console
warnings I see are:
Warning: assignment to undeclared variable i
Source File: http://bugzilla.mozilla.org/query.cgi
Line: 278
Warning: assignment to undeclared variable comp
Source File: http://bugzilla.mozilla.org/query.cgi
Line: 122
Warning: assignment to undeclared variable bitem
Source File: http://bugzilla.mozilla.org/query.cgi
Line: 175
Warning: assignment to undeclared variable aitem
Source File: http://bugzilla.mozilla.org/query.cgi
Line: 179
-----
Please note that I really don't know how to use the JavaScript console, I simply
went into prefs.js and added:
user_pref("javascript.options.strict", true);
then fired up Mozilla, went to Tasks/Tools/Javascript Console, loaded
http://bugzilla.mozilla.org/query.cgi, then clicked on a few of the products.
| Assignee | ||
Comment 57•24 years ago
|
||
| Assignee | ||
Comment 58•24 years ago
|
||
Thanks for the pointer, Jake. I've attached a fix that is quite simple but
solves all warnings I can see in the code. Looking for an r= --- Christopher?
Status: NEW → ASSIGNED
| Assignee | ||
Comment 59•24 years ago
|
||
Thanks for the pointer, Jake. I've attached a fix that is quite simple but
solves all warnings I can see in the code. Looking for an r= --- Christopher?
Comment 60•24 years ago
|
||
Comment on attachment 49072 [details] [diff] [review]
remove JS warning from current query.cgi code
>Index: query.cgi
>@@ -539,10 +540,10 @@
>- if ( !f ) {
>+ if ( ( !f ) || ( ! ( "product" in f ) ) || ( ! f.product ) ) {
This should be: if (!f.product) {
|"product" in f| is the same as |f.product| but needs to iterate through
the objects properties whereas f.product just looks for the property
And if f.product returns false, we don't care whether or not f is
there. If it returns true, then f is obviously true.
| Assignee | ||
Comment 61•24 years ago
|
||
Christopher, I'm afraid you're wrong :)
|"product" in f| is NOT the same as |f.product| -- if f is set but
f.product not, the second test generates a warning, whereas the first one
does not.
At times, f also comes in false in other browsers (Opera, IIRC) during
which the form exists but is not ready. For this reason, I need to check
for it too.
Is that your only complaint? Perhaps I should comment that part a bit
more? :)
Comment 62•24 years ago
|
||
I wasn't aware that some browsers horked that. Really those should be bugs that
are in the other browsers but I guess we need to account for them anyway.
Is there any reason then that we need all 3 checks? Even with your comments, it
makes sense for only: if (!f || !f.product). Is there some other horkage going on?
| Assignee | ||
Comment 63•24 years ago
|
||
Christopher, the onSelect() event is generated a couple of times before
the form and controls are "ready" AFAICT. If I leave the checks out, a
series of warnings and errors are generated:
Warning: reference to undefined property f.property
Warning: reference to undefined property f.property
Warning: reference to undefined property f.property
Warning: reference to undefined property f.property
Error: f.product has no properties
I should point out that these could be browser bugs (why is onSelect()
being called if we're not selecting things) but other browsers present
some of them too AFAICT.
I've decided, however, to leave out the | if ( ! ( 'product' in f ) |
check now because this test seems unimplemented in NS4. :( New patch and
bug being filed for the extra events.
| Assignee | ||
Comment 64•24 years ago
|
||
Comment 65•24 years ago
|
||
Comment on attachment 49229 [details] [diff] [review]
v3: change onload to use form name instead of number, avoid future breakage. 0 warnings.
r=me
Attachment #49229 -
Flags: review+
Comment 66•24 years ago
|
||
Comment on attachment 49229 [details] [diff] [review]
v3: change onload to use form name instead of number, avoid future breakage. 0 warnings.
I don't see any more warnings...
r= jake
Attachment #49229 -
Flags: review+
Comment 68•24 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 24 years ago → 24 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
QA Contact: matty_is_a_geek → default-qa
You need to log in
before you can comment on or make changes to this bug.
Description
•