Bug 225818: %FORM, %MFORM, and %COOKIE need to go away, in favor of the CGI methods - Patch by Teemu Mannermaa <wicked@etlicon.fi> r=LpSolit a=myk

This commit is contained in:
lpsolit%gmail.com 2005-04-09 23:18:18 +00:00
parent 776c625d1d
commit 128cfd9404
6 changed files with 11 additions and 36 deletions

View File

@ -841,9 +841,6 @@ sub match_field {
$cgi->append(-name=>$field,
-values=>[@{$users}[0]->{'login'}]);
# XXX FORM compatilibity code, will be removed in bug 225818
$::FORM{$field} = join(" ", $cgi->param($field));
next;
}
@ -857,9 +854,6 @@ sub match_field {
$cgi->append(-name=>$field,
-values=>[@{$users}[0]->{'login'}]);
# XXX FORM compatilibity code, will be removed in bug 225818
$::FORM{$field} = join(" ", $cgi->param($field));
$need_confirm = 1 if &::Param('confirmuniqueusermatch');
}

View File

@ -401,18 +401,6 @@ use Bugzilla;
# XXX - mod_perl - reset this between runs
$::cgi = Bugzilla->cgi;
# Set up stuff for compatibility with the old CGI.pl code
# This code will be removed as soon as possible, in favour of
# using the CGI.pm stuff directly
# XXX - mod_perl - reset these between runs
foreach my $name ($::cgi->param()) {
my @val = $::cgi->param($name);
$::FORM{$name} = join('', @val);
$::MFORM{$name} = \@val;
}
$::buffer = $::cgi->query_string();
# This could be needed in any CGI, so we set it here.

View File

@ -111,7 +111,8 @@ my $component_id = get_component_id($product_id,
scalar($cgi->param('component')));
$component_id || ThrowUserError("require_component");
if (!$cgi->param('short_desc') || trim($cgi->param('short_desc')) eq "") {
if (!defined $cgi->param('short_desc')
|| trim($cgi->param('short_desc')) eq "") {
ThrowUserError("require_summary");
}
@ -163,7 +164,7 @@ if (Param("useqacontact")) {
if (UserInGroup("editbugs") || UserInGroup("canconfirm")) {
# Default to NEW if the user hasn't selected another status
if (!$cgi->param('bug_status')) {
if (!defined $cgi->param('bug_status')) {
$cgi->param(-name => 'bug_status', -value => "NEW");
}
} else {
@ -361,7 +362,6 @@ if (UserInGroup(Param("timetrackinggroup")) &&
if ((UserInGroup(Param("timetrackinggroup"))) && ($cgi->param('deadline'))) {
Bugzilla::Util::ValidateDate($cgi->param('deadline'), 'YYYY-MM-DD');
my $str = $cgi->param('deadline');
$sql .= SqlQuote($cgi->param('deadline'));
} else {
$sql .= "NULL";

View File

@ -260,7 +260,7 @@ if (((defined $cgi->param('id') && $cgi->param('product') ne $oldproduct)
&& CheckonComment( "reassignbycomponent" ))
{
# Check to make sure they actually have the right to change the product
if (!CheckCanChangeField('product', $cgi->param('id'), $oldproduct,
if (!CheckCanChangeField('product', scalar $cgi->param('id'), $oldproduct,
$cgi->param('product'))) {
$vars->{'oldvalue'} = $oldproduct;
$vars->{'newvalue'} = $cgi->param('product');
@ -614,7 +614,7 @@ sub DoComma {
}
sub DoConfirm {
if (CheckCanChangeField("canconfirm", $cgi->param('id'), 0, 1)) {
if (CheckCanChangeField("canconfirm", scalar $cgi->param('id'), 0, 1)) {
DoComma();
$::query .= "everconfirmed = 1";
}
@ -1301,8 +1301,7 @@ foreach my $id (@idlist) {
{ product => $oldhash{'product'} });
}
if (defined $cgi->param('product')
&& $cgi->param('product') ne $cgi->param('dontchange')
if ($cgi->param('product') ne $cgi->param('dontchange')
&& $cgi->param('product') ne $oldhash{'product'}
&& !CanEnterProduct($cgi->param('product'))) {
ThrowUserError("entry_access_denied",
@ -1494,9 +1493,7 @@ foreach my $id (@idlist) {
}
my $newproduct_id = $oldhash{'product_id'};
if ((defined $cgi->param('product'))
&& ($cgi->param('product') ne $cgi->param('dontchange')))
{
if ($cgi->param('product') ne $cgi->param('dontchange')) {
my $newproduct_id = get_product_id($cgi->param('product'));
}
@ -1648,8 +1645,7 @@ foreach my $id (@idlist) {
# conditions under which these activities take place, more information
# about which can be found in comments within the conditionals below.
# Check if the user has changed the product to which the bug belongs;
if (defined $cgi->param('product')
&& $cgi->param('product') ne $cgi->param('dontchange')
if ($cgi->param('product') ne $cgi->param('dontchange')
&& $cgi->param('product') ne $oldhash{'product'}
) {
$newproduct_id = get_product_id($cgi->param('product'));

View File

@ -417,10 +417,6 @@
'linktext.$type',
],
'bug/create/comment.txt.tmpl' => [
'form.comment',
],
'bug/create/create.html.tmpl' => [
'g.bit',
'g.description',

View File

@ -62,9 +62,10 @@ Attachment [% attidsummary %]
[%- END %]
[%- FILTER bullet = wrap(80) %]
[% IF form.comment.length > 0 %]
[% USE Bugzilla %]
[% IF Bugzilla.cgi.param("comment").length > 0 %]
------- Additional Comments from [% user.identity %]
[%+ form.comment %]
[%+ Bugzilla.cgi.param("comment") %]
[% END %]
[%- END %]