fix from Lucas Bartholemy

This commit is contained in:
JT Smith 2006-05-04 15:54:39 +00:00
parent 10e8ee5957
commit 18e303421a
5 changed files with 36 additions and 1 deletions

View file

@ -1898,6 +1898,7 @@ sub www_editSave {
my $object;
if ($self->session->form->process("assetId") eq "new") {
$object = $self->addChild({className=>$self->session->form->process("class")});
return $self->www_view unless defined $object;
$object->{_parent} = $self;
} else {
if ($self->canEditIfLocked) {

View file

@ -33,6 +33,25 @@ our @ISA = qw(WebGUI::Asset);
#-------------------------------------------------------------------
=head2 addChild
Overriding to limit the types of children allowed.
=cut
sub addChild {
my $self = shift;
my $properties = shift;
my @other = @_;
if ($properties->{className} ne "WebGUI::Asset::Post") {
$self->session->errorHandler->security("tried to add a ".$properties->{className}." to a ".$self->get("className"));
return undef;
}
return $self->SUPER::addChild($properties, @other);
}
#-------------------------------------------------------------------
=head2 addRevision

View file

@ -24,6 +24,19 @@ use WebGUI::Workflow::Cron;
our @ISA = qw(WebGUI::Asset::Wobject);
#-------------------------------------------------------------------
sub addChild {
my $self = shift;
my $properties = shift;
my @other = @_;
if ($properties->{className} ne "WebGUI::Asset::Post::Thread") {
$self->session->errorHandler->security("tried to add a ".$properties->{className}." to a ".$self->get("className"));
return undef;
}
return $self->SUPER::addChild($properties, @other);
}
#-------------------------------------------------------------------
sub appendPostListTemplateVars {
my $self = shift;