Closed
Bug 86300
Opened 23 years ago
Closed 23 years ago
Multiple usage of potentially uninitialized variables in globals.pl/GetBugLink
Categories
(Bugzilla :: Bugzilla-General, defect, P2)
Tracking
()
RESOLVED
FIXED
Bugzilla 2.16
People
(Reporter: bugzillauser, Assigned: jacob)
References
Details
Attachments
(1 file, 4 obsolete files)
(deleted),
patch
|
CodeMachine
:
review+
gerv
:
review+
|
Details | Diff | Splinter Review |
I am getting the following warnings in my web server (Apache) log file when
running bugzilla locally:
Use of uninitialized value at globals.pl line 795 (#1)
Use of uninitialized value at globals.pl line 796 (#1)
Use of uninitialized value at globals.pl line 797 (#1)
Use of uninitialized value at globals.pl line 799 (#1)
Use of uninitialized value at globals.pl line 800 (#1)
This appears to be due to NULLs being returned by the SQL query a few lines
back.
Reporter | ||
Comment 1•23 years ago
|
||
Also occurs on earlier lines 791 and 792 (and causes similar problems within
the value_quote() calls on the next lines.
Further investigation reveals that the reason I am seeing this error is that I
have the text ... see bug <number> ... in my bug description, where <number> is
not a bugnumber existing in the bugzilla database (I was referring back to bug
numbers in a previous database I had migrated from into bugzilla).
GetBugLink should check for this case, and not produce a link if it occurs.
Assignee | ||
Comment 2•23 years ago
|
||
One of things I intend to do sometime soon is start looking at my webserver logs
and trying to solve some various warnings (There currently aren't any compile
time warings, but there are a few run-time).
Also, there's a bug somewhere about not turing bug ### into a link if it's
doesn't exist which would also solve this particular problem.
Assignee: tara → jake
Target Milestone: --- → Bugzilla 2.16
Reporter | ||
Comment 3•23 years ago
|
||
Reporter | ||
Comment 5•23 years ago
|
||
Reporter | ||
Comment 6•23 years ago
|
||
Sorry. Patch is (obviously) against 2.12 not 1.12!
Updated•23 years ago
|
Priority: -- → P2
Updated•23 years ago
|
Updated•23 years ago
|
Severity: minor → normal
Assignee | ||
Updated•23 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Updated•23 years ago
|
Component: Bugzilla → Bugzilla-General
Product: Webtools → Bugzilla
Version: Bugzilla 2.12 → 2.12
Comment 7•23 years ago
|
||
Comment on attachment 39479 [details] [diff] [review]
Patch (against 1.12) to fix this problem
Needs work. Would be cleaner if the code, including the my declaration, was inside if (MoreSQLData()).
Attachment #39479 -
Flags: review-
Updated•23 years ago
|
Assignee | ||
Comment 8•23 years ago
|
||
Assignee | ||
Comment 9•23 years ago
|
||
The patch I just uploaded uses if (MoreSQLData()), is against current CVS (to
incorporate recent changes in that routine) and also impliments a cache so if
the same bug number is mentioned twice in one report (which is fairly common) it
only has to run the SQL query once.
Assignee | ||
Comment 10•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Attachment #55062 -
Attachment is obsolete: true
Comment 11•23 years ago
|
||
This looks good, but I think the cache should be on bug number and link text,
since it relies on the latter.
Comment 12•23 years ago
|
||
Given the fact the number is numeric, there should be no problems in you key on
"$bugnum-$linktext".
Comment 13•23 years ago
|
||
Actually, that would fail to cache the SQL results between the same bug but with
different link text (eg bug XXXXX and bug #XXXXX).
Since we're really interested in caching the SQL results (I assume), maybe we
should just cache a reference to the record list.
Assignee | ||
Comment 14•23 years ago
|
||
Assignee | ||
Comment 15•23 years ago
|
||
That's a very good point. This latest patch caches the values that can be used
to build the link, not the link itslef.
Assignee | ||
Updated•23 years ago
|
Attachment #55064 -
Attachment is obsolete: true
Comment 16•23 years ago
|
||
Looks good, except:
if ($bug_state eq $::unconfirmedstate) {
...
if (! IsOpenedState($bug_state)) {
This should probably be else. It doesn't matter but I think it makes it more
obvious.
Also, please quote the resolution and status. ATM people can hack their
installations, soon they will have custom resolutions and hopefully statuses for
2.18.
Assignee | ||
Comment 17•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Attachment #55490 -
Attachment is obsolete: true
Assignee | ||
Comment 18•23 years ago
|
||
I had a dream last night about using elsif there... :)
Anyway, I've now run $title through value_quote() right before dumping it out to
the %::buglink hash instead of doing each part individually (not that it matters
much, it just meant I didn't have to type value_quote() as much :)
Updated•23 years ago
|
Attachment #39479 -
Attachment is obsolete: true
Comment 19•23 years ago
|
||
Comment on attachment 55548 [details] [diff] [review]
value_quote() the entire $title
I'm a big fan of your work.
Attachment #55548 -
Flags: review+
Comment 20•23 years ago
|
||
This also fixes bug #85709, I believe.
I'm thinking we should change the presentational HTML to CSS classes on the
status, or perhaps templatise the HTML that gets output, but that is not
necessary for this bug.
Comment 21•23 years ago
|
||
Comment on attachment 55548 [details] [diff] [review]
value_quote() the entire $title
If Matty tested the patch, r=gerv. If he didn't, someone will have to, so
!r=gerv :-)
Gerv
Attachment #55548 -
Flags: review+
Assignee | ||
Comment 22•23 years ago
|
||
mpt: I saw in #mozwebtools this evening where you mentioned that you didn't want
Bugzilla to link to non-existant bugs... that's covered in the patch to this bug.
Comment 23•23 years ago
|
||
I tested it, but I think both reviewers are supposed to test.
Comment 24•23 years ago
|
||
Oh, check it in :-)
Gerv
Assignee | ||
Comment 25•23 years ago
|
||
Checking in globals.pl;
/cvsroot/mozilla/webtools/bugzilla/globals.pl,v <-- globals.pl
new revision: 1.126; previous revision: 1.125
done
Assignee | ||
Comment 26•23 years ago
|
||
must... click... radio... button...
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 27•23 years ago
|
||
*** Bug 85709 has been marked as a duplicate of this bug. ***
Comment 28•23 years ago
|
||
*** Bug 136723 has been marked as a duplicate of this bug. ***
Comment 29•23 years ago
|
||
*** Bug 119890 has been marked as a duplicate of this bug. ***
Comment 30•23 years ago
|
||
*** Bug 144173 has been marked as a duplicate of this bug. ***
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
•