bug fixes related to configurable asset properties
This commit is contained in:
parent
c25101654f
commit
ede1f674b3
1 changed files with 17 additions and 7 deletions
|
|
@ -1965,21 +1965,32 @@ sub processPropertiesFromFormPost {
|
|||
my $self = shift;
|
||||
my %data;
|
||||
my $form = $self->session->form;
|
||||
my $overrides = $self->session->config->get("assets/".$self->get("className")."/fields");
|
||||
|
||||
foreach my $definition (@{$self->definition($self->session)}) {
|
||||
foreach my $property (keys %{$definition->{properties}}) {
|
||||
if ($definition->{properties}{$property}{noFormPost}) {
|
||||
my %params = %{$definition->{properties}{$property}};
|
||||
|
||||
# apply config file changes
|
||||
foreach my $key (keys %{$overrides->{$property}}) {
|
||||
$params{$key} = $overrides->{$property}{$key};
|
||||
}
|
||||
|
||||
# deal with properties that can't be posted through the form
|
||||
if ($params{noFormPost}) {
|
||||
if ($form->process("assetId") eq "new" && $self->get($property) eq "") {
|
||||
$data{$property} = $definition->{properties}{$property}{defaultValue};
|
||||
$data{$property} = $params{defaultValue};
|
||||
}
|
||||
next;
|
||||
}
|
||||
my %params = %{$definition->{properties}{$property}};
|
||||
|
||||
# process the form element
|
||||
$params{name} = $property;
|
||||
$params{value} = $self->get($property);
|
||||
$data{$property} = $form->process(
|
||||
$property,
|
||||
$definition->{properties}{$property}{fieldType},
|
||||
$definition->{properties}{$property}{defaultValue},
|
||||
$params{fieldType},
|
||||
$params{defaultValue},
|
||||
\%params
|
||||
);
|
||||
}
|
||||
|
|
@ -2205,7 +2216,7 @@ to set the keywords for this asset.
|
|||
sub update {
|
||||
my $self = shift;
|
||||
my $properties = shift;
|
||||
|
||||
|
||||
# if keywords were specified, then let's set them the right way
|
||||
if (exists $properties->{keywords}) {
|
||||
WebGUI::Keyword->new($self->session)->setKeywordsForAsset(
|
||||
|
|
@ -2247,7 +2258,6 @@ sub update {
|
|||
next;
|
||||
}
|
||||
|
||||
|
||||
# use the update value
|
||||
my $value = $properties->{$property};
|
||||
# use the current value because the update value was undef
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue