Closed Bug 342053 Opened 18 years ago Closed 18 years ago

Quicksearch.pm defines $cgi outside routines

Categories

(Bugzilla :: Bugzilla-General, defect)

2.23
defect
Not set
major

Tracking

()

RESOLVED FIXED
Bugzilla 3.0

People

(Reporter: LpSolit, Assigned: LpSolit)

References

Details

Attachments

(1 file)

Quicksearch.pm defines "my $cgi = Bugzilla->cgi;" outside routines. This makes "perl -cwT buglist.cgi" to fail, because buglist.cgi uses Quicksearch.pm. I saw this problem a few seconds before committing my patch about the removal of versioncache. ;) We have to fix this before committing my patch about versioncache.
Attached patch patch, v1Splinter Review
move $cgi definition inside routines which use it.
Attachment #226191 - Flags: review?(myk)
Attachment #226191 - Flags: review?(myk) → review+
Status: NEW → ASSIGNED
Flags: approval?
Flags: approval? → approval+
Checking in Bugzilla/Search/Quicksearch.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Search/Quicksearch.pm,v <-- Quicksearch.pm new revision: 1.7; previous revision: 1.6 done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Summary: Quicksearch.pm defined $cgi outside routines → Quicksearch.pm defines $cgi outside routines
FWIW, it's not possible for a call to "Bugzilla->cgi" to cause a problem at compile-time -- "Bugzilla->cgi" doesn't get resolved until runtime. If this fixed the problem, the problem was something else strange.
I think that's because Bugzilla->cgi calls Param() which loads all params, including those in BugFields.pm, despite $dbh was not yet defined. Moving $cgi = Bugzilla->cgi inside routines prevents to load all these params at compile time. That's my theory.
Ohhh, right, because it's a .pm file. I didn't even think of that. Yeah, of course, .pm files should never define things outside of routines, except in very unusual circumstances.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: