Bug 69481, Bug 61456
git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@1100 6955db30-a419-402b-8a0d-67ecbb4d7f56master
parent
a506c82623
commit
a15b8ccf6e
|
@ -802,9 +802,20 @@ sub remove_from_db {
|
|||
|
||||
$self->set_visibility_values(undef);
|
||||
|
||||
delete Bugzilla->request_cache->{fields};
|
||||
|
||||
$dbh->bz_commit_transaction();
|
||||
}
|
||||
|
||||
# Overridden update() method - flushes field cache
|
||||
sub update
|
||||
{
|
||||
my $self = shift;
|
||||
my ($changes, $old_self) = $self->SUPER::update(@_);
|
||||
delete Bugzilla->request_cache->{fields};
|
||||
return wantarray ? ($changes, $old_self) : $changes;
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head2 Class Methods
|
||||
|
@ -873,7 +884,12 @@ sub create {
|
|||
}
|
||||
|
||||
# Call real constructor
|
||||
return $class->SUPER::create($params);
|
||||
my $self = $class->SUPER::create($params);
|
||||
|
||||
# Flush field cache
|
||||
delete Bugzilla->request_cache->{fields};
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub run_create_validators {
|
||||
|
|
|
@ -61,8 +61,8 @@ use constant LIST_ORDER => 'sortkey, value';
|
|||
use constant REQUIRED_CREATE_FIELDS => qw(value);
|
||||
|
||||
use constant VALIDATORS => {
|
||||
value => \&_check_value,
|
||||
sortkey => \&_check_sortkey,
|
||||
value => \&_check_value,
|
||||
sortkey => \&_check_sortkey,
|
||||
isactive => \&Bugzilla::Object::check_boolean,
|
||||
};
|
||||
|
||||
|
|
|
@ -117,10 +117,10 @@ if ($action eq 'add') {
|
|||
if ($action eq 'new') {
|
||||
check_token_data($token, 'add_field_value');
|
||||
|
||||
my $created_value = Bugzilla::Field::Choice->type($field)->create({
|
||||
value => scalar $cgi->param('value'),
|
||||
sortkey => scalar $cgi->param('sortkey'),
|
||||
is_open => scalar $cgi->param('is_open'),
|
||||
my $type = Bugzilla::Field::Choice->type($field);
|
||||
# Some types have additional parameters inside REQUIRED_CREATE_FIELDS
|
||||
my $created_value = $type->create({
|
||||
map { $_ => scalar $cgi->param($_) } ($type->DB_COLUMNS, $type->REQUIRED_CREATE_FIELDS)
|
||||
});
|
||||
$created_value->set_visibility_values([ $cgi->param('visibility_value_id') ]);
|
||||
|
||||
|
|
|
@ -77,7 +77,6 @@
|
|||
%]
|
||||
[% END %]
|
||||
|
||||
|
||||
[% overrides.action.obsolete = {
|
||||
"1" => {
|
||||
override_content => 1
|
||||
|
@ -86,7 +85,7 @@
|
|||
contentlink => delete_contentlink
|
||||
}
|
||||
}
|
||||
%]
|
||||
%]
|
||||
|
||||
<h2>Custom fields</h2>
|
||||
|
||||
|
|
Loading…
Reference in New Issue