rework how validParent works, and where it is checked. Add an explicit check for it in addChild, and remove a bunch of overridden addChild methods.
This commit is contained in:
parent
a8496c4d15
commit
88ec09d279
12 changed files with 78 additions and 110 deletions
|
|
@ -118,19 +118,19 @@ does not exist, then make it.
|
|||
|
||||
=cut
|
||||
|
||||
sub addChild {
|
||||
override addChild => sub {
|
||||
my $self = shift;
|
||||
my ($properties) = @_;
|
||||
##Allow subclassing
|
||||
if ($properties->{className} eq 'WebGUI::Asset::Wobject::Folder') {
|
||||
return $self->SUPER::addChild(@_);
|
||||
return super();
|
||||
}
|
||||
return undef unless $properties->{className} =~ /^WebGUI::Asset::Story/;
|
||||
my $todayFolder = $self->getFolder;
|
||||
return undef unless $todayFolder;
|
||||
my $story = $todayFolder->addChild(@_);
|
||||
return $story;
|
||||
}
|
||||
};
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue