Commit c15ee7a4 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 225818: %FORM, %MFORM, and %COOKIE need to go away, in favor of the CGI…

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
parent add73503
...@@ -841,9 +841,6 @@ sub match_field { ...@@ -841,9 +841,6 @@ sub match_field {
$cgi->append(-name=>$field, $cgi->append(-name=>$field,
-values=>[@{$users}[0]->{'login'}]); -values=>[@{$users}[0]->{'login'}]);
# XXX FORM compatilibity code, will be removed in bug 225818
$::FORM{$field} = join(" ", $cgi->param($field));
next; next;
} }
...@@ -857,9 +854,6 @@ sub match_field { ...@@ -857,9 +854,6 @@ sub match_field {
$cgi->append(-name=>$field, $cgi->append(-name=>$field,
-values=>[@{$users}[0]->{'login'}]); -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'); $need_confirm = 1 if &::Param('confirmuniqueusermatch');
} }
......
...@@ -401,18 +401,6 @@ use Bugzilla; ...@@ -401,18 +401,6 @@ use Bugzilla;
# XXX - mod_perl - reset this between runs # XXX - mod_perl - reset this between runs
$::cgi = Bugzilla->cgi; $::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(); $::buffer = $::cgi->query_string();
# This could be needed in any CGI, so we set it here. # This could be needed in any CGI, so we set it here.
......
...@@ -111,7 +111,8 @@ my $component_id = get_component_id($product_id, ...@@ -111,7 +111,8 @@ my $component_id = get_component_id($product_id,
scalar($cgi->param('component'))); scalar($cgi->param('component')));
$component_id || ThrowUserError("require_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"); ThrowUserError("require_summary");
} }
...@@ -163,7 +164,7 @@ if (Param("useqacontact")) { ...@@ -163,7 +164,7 @@ if (Param("useqacontact")) {
if (UserInGroup("editbugs") || UserInGroup("canconfirm")) { if (UserInGroup("editbugs") || UserInGroup("canconfirm")) {
# Default to NEW if the user hasn't selected another status # 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"); $cgi->param(-name => 'bug_status', -value => "NEW");
} }
} else { } else {
...@@ -361,7 +362,6 @@ if (UserInGroup(Param("timetrackinggroup")) && ...@@ -361,7 +362,6 @@ if (UserInGroup(Param("timetrackinggroup")) &&
if ((UserInGroup(Param("timetrackinggroup"))) && ($cgi->param('deadline'))) { if ((UserInGroup(Param("timetrackinggroup"))) && ($cgi->param('deadline'))) {
Bugzilla::Util::ValidateDate($cgi->param('deadline'), 'YYYY-MM-DD'); Bugzilla::Util::ValidateDate($cgi->param('deadline'), 'YYYY-MM-DD');
my $str = $cgi->param('deadline');
$sql .= SqlQuote($cgi->param('deadline')); $sql .= SqlQuote($cgi->param('deadline'));
} else { } else {
$sql .= "NULL"; $sql .= "NULL";
......
...@@ -260,7 +260,7 @@ if (((defined $cgi->param('id') && $cgi->param('product') ne $oldproduct) ...@@ -260,7 +260,7 @@ if (((defined $cgi->param('id') && $cgi->param('product') ne $oldproduct)
&& CheckonComment( "reassignbycomponent" )) && CheckonComment( "reassignbycomponent" ))
{ {
# Check to make sure they actually have the right to change the product # 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'))) { $cgi->param('product'))) {
$vars->{'oldvalue'} = $oldproduct; $vars->{'oldvalue'} = $oldproduct;
$vars->{'newvalue'} = $cgi->param('product'); $vars->{'newvalue'} = $cgi->param('product');
...@@ -614,7 +614,7 @@ sub DoComma { ...@@ -614,7 +614,7 @@ sub DoComma {
} }
sub DoConfirm { sub DoConfirm {
if (CheckCanChangeField("canconfirm", $cgi->param('id'), 0, 1)) { if (CheckCanChangeField("canconfirm", scalar $cgi->param('id'), 0, 1)) {
DoComma(); DoComma();
$::query .= "everconfirmed = 1"; $::query .= "everconfirmed = 1";
} }
...@@ -1301,8 +1301,7 @@ foreach my $id (@idlist) { ...@@ -1301,8 +1301,7 @@ foreach my $id (@idlist) {
{ product => $oldhash{'product'} }); { product => $oldhash{'product'} });
} }
if (defined $cgi->param('product') if ($cgi->param('product') ne $cgi->param('dontchange')
&& $cgi->param('product') ne $cgi->param('dontchange')
&& $cgi->param('product') ne $oldhash{'product'} && $cgi->param('product') ne $oldhash{'product'}
&& !CanEnterProduct($cgi->param('product'))) { && !CanEnterProduct($cgi->param('product'))) {
ThrowUserError("entry_access_denied", ThrowUserError("entry_access_denied",
...@@ -1494,9 +1493,7 @@ foreach my $id (@idlist) { ...@@ -1494,9 +1493,7 @@ foreach my $id (@idlist) {
} }
my $newproduct_id = $oldhash{'product_id'}; my $newproduct_id = $oldhash{'product_id'};
if ((defined $cgi->param('product')) if ($cgi->param('product') ne $cgi->param('dontchange')) {
&& ($cgi->param('product') ne $cgi->param('dontchange')))
{
my $newproduct_id = get_product_id($cgi->param('product')); my $newproduct_id = get_product_id($cgi->param('product'));
} }
...@@ -1648,8 +1645,7 @@ foreach my $id (@idlist) { ...@@ -1648,8 +1645,7 @@ foreach my $id (@idlist) {
# conditions under which these activities take place, more information # conditions under which these activities take place, more information
# about which can be found in comments within the conditionals below. # about which can be found in comments within the conditionals below.
# Check if the user has changed the product to which the bug belongs; # Check if the user has changed the product to which the bug belongs;
if (defined $cgi->param('product') if ($cgi->param('product') ne $cgi->param('dontchange')
&& $cgi->param('product') ne $cgi->param('dontchange')
&& $cgi->param('product') ne $oldhash{'product'} && $cgi->param('product') ne $oldhash{'product'}
) { ) {
$newproduct_id = get_product_id($cgi->param('product')); $newproduct_id = get_product_id($cgi->param('product'));
......
...@@ -417,10 +417,6 @@ ...@@ -417,10 +417,6 @@
'linktext.$type', 'linktext.$type',
], ],
'bug/create/comment.txt.tmpl' => [
'form.comment',
],
'bug/create/create.html.tmpl' => [ 'bug/create/create.html.tmpl' => [
'g.bit', 'g.bit',
'g.description', 'g.description',
......
...@@ -62,9 +62,10 @@ Attachment [% attidsummary %] ...@@ -62,9 +62,10 @@ Attachment [% attidsummary %]
[%- END %] [%- END %]
[%- FILTER bullet = wrap(80) %] [%- FILTER bullet = wrap(80) %]
[% IF form.comment.length > 0 %] [% USE Bugzilla %]
[% IF Bugzilla.cgi.param("comment").length > 0 %]
------- Additional Comments from [% user.identity %] ------- Additional Comments from [% user.identity %]
[%+ form.comment %] [%+ Bugzilla.cgi.param("comment") %]
[% END %] [% END %]
[%- END %] [%- END %]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment