Closed
Bug 731175
Opened 12 years ago
Closed 12 years ago
Bugzilla::Field shouldn't assume that someone else already loaded required modules
Categories
(Bugzilla :: Bugzilla-General, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 4.4
People
(Reporter: LpSolit, Assigned: LpSolit)
References
Details
Attachments
(1 file, 1 obsolete file)
1.46 KB,
patch
|
glob
:
review+
|
Details | Diff | Splinter Review |
I realized that if I remove |use Bugzilla::Bug| from Template.pm (because this is only needed in get_bug_link(), i.e. when viewing bugs only, and we can avoid the load time penalty for other pages), Bugzilla::Field->legal_values crashes complaining that modules such as Bugzilla::Component aren't loaded. The reason is that currently, |use Bugzilla| called from CGI scripts loads Bugzilla::Template, which loads Bugzilla::Bug, which loads Bugzilla::Component & co. This is a very bad assumption and a weak dependency chain, and legal_values() should load these modules itself before calling get_all(). I also removed two other useless |use Bugzilla::Foo| from Template.pm.
Attachment #601245 -
Flags: review?(glob)
Assignee | ||
Comment 1•12 years ago
|
||
Actually, there are several methods in Field.pm which have the same problem.
Summary: legal_values() shouldn't assume that someone else already loaded required modules → Bugzilla::Field shouldn't assume that someone else already loaded required modules
Assignee | ||
Comment 2•12 years ago
|
||
Attachment #601245 -
Attachment is obsolete: true
Attachment #601252 -
Flags: review?(glob)
Attachment #601245 -
Flags: review?(glob)
Comment on attachment 601252 [details] [diff] [review] patch, v1.1 r=glob
Attachment #601252 -
Flags: review?(glob) → review+
Assignee | ||
Updated•12 years ago
|
Flags: approval+
Assignee | ||
Comment 4•12 years ago
|
||
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/ modified Bugzilla/Template.pm modified Bugzilla/Field/Choice.pm Committed revision 8141.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•