Closed
Bug 282124
Opened 20 years ago
Closed 20 years ago
Remove globals.pl and CGI.pl from editclassifications.cgi
Categories
(Bugzilla :: Bugzilla-General, enhancement)
Tracking
()
RESOLVED
FIXED
Bugzilla 2.20
People
(Reporter: mkanat, Assigned: mkanat)
References
Details
Attachments
(1 file, 1 obsolete file)
1.58 KB,
patch
|
goobix
:
review+
|
Details | Diff | Splinter Review |
This script doesn't really need these libraries. The calls to them can be safely
removed with only minor changes.
Assignee | ||
Updated•20 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → Bugzilla 2.20
Assignee | ||
Comment 1•20 years ago
|
||
Assignee | ||
Updated•20 years ago
|
Attachment #174222 -
Flags: review?
Assignee | ||
Comment 2•20 years ago
|
||
This makes it more exactly like what globals.pl used to do.
Attachment #174222 -
Attachment is obsolete: true
Attachment #174224 -
Flags: review?
Assignee | ||
Updated•20 years ago
|
Attachment #174222 -
Flags: review?
Updated•20 years ago
|
Attachment #174224 -
Flags: review? → review+
Assignee | ||
Updated•20 years ago
|
Flags: approval?
Comment 3•20 years ago
|
||
Question: are any of those perl modules depending on being able to access $::vars?
We need to make sure the modules aren't expecting $::vars to exist as well.
(If you've done that, say so and you've got my approval)
Assignee | ||
Comment 4•20 years ago
|
||
Oh, good point.
Of course, doesn't having a "my $vars" in the CGI actually create a $main::vars?
That is, isn't the CGI $main? I'll investigate it, though. We're not using too
many of the module functions.
Assignee | ||
Comment 5•20 years ago
|
||
OK, so nothing that we use depends on the global $::vars:
[mkanat@landfill mkanat]$ grep -R "::vars" Bugzilla*
Bugzilla/Flag.pm:# so I have to use them as $::template and $::vars in the
package code.
Bugzilla/Flag.pm: $::vars->{'flag'} = $flag;
Bugzilla/Flag.pm: $::template->process($template_file, $::vars, \$message);
Bugzilla/Token.pm: my $vars = $::vars;
Bugzilla/Token.pm: my $vars = $::vars;
Bugzilla/Token.pm: my $vars = $::vars;
Bugzilla/User.pm: my $vars = $::vars;
That Bugzilla::User function is match_field, which we definitely don't use. :-)
So we're good to go.
Comment 6•20 years ago
|
||
(In reply to comment #4)
> Of course, doesn't having a "my $vars" in the CGI actually create a $main::vars?
"my $vars" creates a variable which is not in a namespace, and is scoped locally
to the current code block. It can't be referenced from outside the block of
code containing it. (think braces {} )
> That is, isn't the CGI $main?
Only if it's running standalone. If it's running under mod_perl, the CGI will
be ModPerl::PerlRun::ROOT::editcomponents_e2cgi:: or something to that effect,
and $::vars will still refer to main::.
Note that |use vars qw( $vars )| will import $::vars into the local namespace so
it can be referenced as $vars, so make sure you're looking for that as well when
looking in the modules.
> I'll investigate it, though. We're not using too many of the module functions.
In the long run, it'd probably be best that we fix the modules to require $vars
to be passed in to them instead of looking for it at $::vars.
Flags: approval? → approval+
Assignee | ||
Comment 7•20 years ago
|
||
Checking in editclassifications.cgi;
/cvsroot/mozilla/webtools/bugzilla/editclassifications.cgi,v <--
editclassifications.cgi
new revision: 1.4; previous revision: 1.3
done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•