Fix input_params
parent
cb58d0da87
commit
af5945dfd1
10
Bugzilla.pm
10
Bugzilla.pm
|
@ -491,8 +491,13 @@ sub input_params
|
||||||
}
|
}
|
||||||
return $cache->{input_params} if defined $cache->{input_params};
|
return $cache->{input_params} if defined $cache->{input_params};
|
||||||
|
|
||||||
# Throw away the tie.
|
$cache->{input_params} = {};
|
||||||
$cache->{input_params} = { %{ $class->cgi->Vars } };
|
my $cgi = $class->cgi;
|
||||||
|
for ($cgi->param)
|
||||||
|
{
|
||||||
|
my @v = $cgi->param($_);
|
||||||
|
$cache->{input_params}->{$_} = @v <= 1 ? $v[0] : \@v;
|
||||||
|
}
|
||||||
return $cache->{input_params};
|
return $cache->{input_params};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -998,6 +1003,7 @@ sub fieldvaluecontrol
|
||||||
);
|
);
|
||||||
for (@$rows)
|
for (@$rows)
|
||||||
{
|
{
|
||||||
|
next if !defined $_->{default_field_id}; # FIXME: means field_defaults table has inconsistent data
|
||||||
$has->{$_->{default_field_id}}
|
$has->{$_->{default_field_id}}
|
||||||
->{defaults}
|
->{defaults}
|
||||||
->{$_->{field_id}}
|
->{$_->{field_id}}
|
||||||
|
|
|
@ -1808,7 +1808,7 @@ sub _set_alias
|
||||||
return $self->{alias} = undef if !$alias;
|
return $self->{alias} = undef if !$alias;
|
||||||
|
|
||||||
# Make sure the alias isn't too long.
|
# Make sure the alias isn't too long.
|
||||||
if (length($alias) > 20)
|
if (length($alias) > 255)
|
||||||
{
|
{
|
||||||
ThrowUserError('alias_too_long');
|
ThrowUserError('alias_too_long');
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,7 @@ use Scalar::Util qw(blessed);
|
||||||
use Storable qw(dclone);
|
use Storable qw(dclone);
|
||||||
|
|
||||||
use base qw(Bugzilla::Object Exporter);
|
use base qw(Bugzilla::Object Exporter);
|
||||||
|
# FIXME Remove procedural APIs
|
||||||
@Bugzilla::User::EXPORT = qw(is_available_username
|
@Bugzilla::User::EXPORT = qw(is_available_username
|
||||||
login_to_id user_id_to_login validate_password
|
login_to_id user_id_to_login validate_password
|
||||||
USER_MATCH_MULTIPLE USER_MATCH_FAILED USER_MATCH_SUCCESS
|
USER_MATCH_MULTIPLE USER_MATCH_FAILED USER_MATCH_SUCCESS
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
<!ELEMENT remaining_time (#PCDATA)>
|
<!ELEMENT remaining_time (#PCDATA)>
|
||||||
<!ELEMENT actual_time (#PCDATA)>
|
<!ELEMENT actual_time (#PCDATA)>
|
||||||
<!ELEMENT deadline (#PCDATA)>
|
<!ELEMENT deadline (#PCDATA)>
|
||||||
<!ELEMENT long_desc (who, bug_when, work_time?, thetext)>
|
<!ELEMENT long_desc (who, type?, bug_when, work_time?, thetext)>
|
||||||
<!ATTLIST long_desc
|
<!ATTLIST long_desc
|
||||||
encoding (base64) #IMPLIED
|
encoding (base64) #IMPLIED
|
||||||
isprivate (0|1) #IMPLIED
|
isprivate (0|1) #IMPLIED
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
# CustIS Bug 61728 - external SQL interface to Bugzilla's bug tables
|
# CustIS Bug 61728 - external SQL interface to Bugzilla's bug tables
|
||||||
|
# FIXME: Add UI for managing views
|
||||||
|
|
||||||
package FlushViews;
|
package FlushViews;
|
||||||
|
|
||||||
|
|
30
importxml.pl
30
importxml.pl
|
@ -433,7 +433,7 @@ my %was_known_as_id = ();
|
||||||
my %depends_to_import = ();
|
my %depends_to_import = ();
|
||||||
|
|
||||||
sub process_bug {
|
sub process_bug {
|
||||||
my ( $twig, $bug ) = @_;
|
my ($twig, $bug_xml) = @_;
|
||||||
my $root = $twig->root;
|
my $root = $twig->root;
|
||||||
my $maintainer = $root->{'att'}->{'maintainer'};
|
my $maintainer = $root->{'att'}->{'maintainer'};
|
||||||
my $exporter_login = $root->{'att'}->{'exporter'};
|
my $exporter_login = $root->{'att'}->{'exporter'};
|
||||||
|
@ -443,16 +443,16 @@ sub process_bug {
|
||||||
|
|
||||||
# We will store output information in this variable.
|
# We will store output information in this variable.
|
||||||
my $log = "";
|
my $log = "";
|
||||||
if ( defined $bug->{'att'}->{'error'} ) {
|
if ( defined $bug_xml->{'att'}->{'error'} ) {
|
||||||
$log .= "\nError in bug " . $bug->field('bug_id') . "\@$urlbase: ";
|
$log .= "\nError in bug " . $bug_xml->field('bug_id') . "\@$urlbase: ";
|
||||||
$log .= $bug->{'att'}->{'error'} . "\n";
|
$log .= $bug_xml->{'att'}->{'error'} . "\n";
|
||||||
if ( $bug->{'att'}->{'error'} =~ /NotFound/ ) {
|
if ( $bug_xml->{'att'}->{'error'} =~ /NotFound/ ) {
|
||||||
$log .= "$exporter_login tried to move bug " . $bug->field('bug_id');
|
$log .= "$exporter_login tried to move bug " . $bug_xml->field('bug_id');
|
||||||
$log .= " here, but $urlbase reports that this bug";
|
$log .= " here, but $urlbase reports that this bug";
|
||||||
$log .= " does not exist.\n";
|
$log .= " does not exist.\n";
|
||||||
}
|
}
|
||||||
elsif ( $bug->{'att'}->{'error'} =~ /NotPermitted/ ) {
|
elsif ( $bug_xml->{'att'}->{'error'} =~ /NotPermitted/ ) {
|
||||||
$log .= "$exporter_login tried to move bug " . $bug->field('bug_id');
|
$log .= "$exporter_login tried to move bug " . $bug_xml->field('bug_id');
|
||||||
$log .= " here, but $urlbase reports that $exporter_login does ";
|
$log .= " here, but $urlbase reports that $exporter_login does ";
|
||||||
$log .= " not have access to that bug.\n";
|
$log .= " not have access to that bug.\n";
|
||||||
}
|
}
|
||||||
|
@ -472,10 +472,10 @@ sub process_bug {
|
||||||
my %bug_fields;
|
my %bug_fields;
|
||||||
my $err = "";
|
my $err = "";
|
||||||
|
|
||||||
# Loop through all the xml tags inside a <bug> and compare them to the
|
# Loop through all the xml tags inside a <bug> and compare them to the
|
||||||
# lists of fields. If they match throw them into the hash. Otherwise
|
# lists of fields. If they match throw them into the hash. Otherwise
|
||||||
# append it to the log, which will go into the comments when we are done.
|
# append it to the log, which will go into the comments when we are done.
|
||||||
foreach my $bugchild ( $bug->children() ) {
|
foreach my $bugchild ( $bug_xml->children() ) {
|
||||||
Debug( "Parsing field: " . $bugchild->name, DEBUG_LEVEL );
|
Debug( "Parsing field: " . $bugchild->name, DEBUG_LEVEL );
|
||||||
|
|
||||||
# Skip the token if one is included. We don't want it included in
|
# Skip the token if one is included. We don't want it included in
|
||||||
|
@ -483,7 +483,7 @@ sub process_bug {
|
||||||
next if $bugchild->name eq 'token';
|
next if $bugchild->name eq 'token';
|
||||||
|
|
||||||
if ( defined $all_fields{ $bugchild->name } ) {
|
if ( defined $all_fields{ $bugchild->name } ) {
|
||||||
my @values = $bug->children_text($bugchild->name);
|
my @values = $bug_xml->children_text($bugchild->name);
|
||||||
if (scalar @values > 1) {
|
if (scalar @values > 1) {
|
||||||
$bug_fields{$bugchild->name} = \@values;
|
$bug_fields{$bugchild->name} = \@values;
|
||||||
}
|
}
|
||||||
|
@ -514,7 +514,7 @@ sub process_bug {
|
||||||
my $private = 0;
|
my $private = 0;
|
||||||
|
|
||||||
# Parse long descriptions
|
# Parse long descriptions
|
||||||
foreach my $comment ( $bug->children('long_desc') ) {
|
foreach my $comment ($bug_xml->children('long_desc')) {
|
||||||
Debug( "Parsing Long Description", DEBUG_LEVEL );
|
Debug( "Parsing Long Description", DEBUG_LEVEL );
|
||||||
my %long_desc;
|
my %long_desc;
|
||||||
$long_desc{'who'} = $comment->field('who');
|
$long_desc{'who'} = $comment->field('who');
|
||||||
|
@ -1190,7 +1190,7 @@ sub process_bug {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Parse bug flags
|
# Parse bug flags
|
||||||
foreach my $bflag ( $bug->children('flag')) {
|
foreach my $bflag ($bug_xml->children('flag')) {
|
||||||
next unless ( defined($bflag) );
|
next unless ( defined($bflag) );
|
||||||
$err .= flag_handler(
|
$err .= flag_handler(
|
||||||
$bflag->{'att'}->{'name'}, $bflag->{'att'}->{'status'},
|
$bflag->{'att'}->{'name'}, $bflag->{'att'}->{'status'},
|
||||||
|
|
|
@ -70,6 +70,9 @@
|
||||||
[% NEXT IF c.is_private && !user.is_insider %]
|
[% NEXT IF c.is_private && !user.is_insider %]
|
||||||
<long_desc isprivate="[% c.is_private | xml %]">
|
<long_desc isprivate="[% c.is_private | xml %]">
|
||||||
<commentid>[% c.id | xml %]</commentid>
|
<commentid>[% c.id | xml %]</commentid>
|
||||||
|
[% IF c.type %]
|
||||||
|
<type>[% c.type | xml %]</type>
|
||||||
|
[% END %]
|
||||||
[% IF c.is_about_attachment %]
|
[% IF c.is_about_attachment %]
|
||||||
<attachid>[% c.extra_data | xml %]</attachid>
|
<attachid>[% c.extra_data | xml %]</attachid>
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
|
@ -133,7 +133,7 @@
|
||||||
|
|
||||||
[% BLOCK error_alias_too_long %]
|
[% BLOCK error_alias_too_long %]
|
||||||
[% title = "Alias Too Long" %]
|
[% title = "Alias Too Long" %]
|
||||||
[% terms.Bug %] aliases cannot be longer than 20 characters.
|
[% terms.Bug %] aliases cannot be longer than 255 characters.
|
||||||
Please choose a shorter alias.
|
Please choose a shorter alias.
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue