diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 3edf2fc25..5aa98b764 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -114,6 +114,7 @@ - added [ 1376374 ] WebGUI should return a Last-Modified http/1.x header - added [ 1216059 ] Admin Bar Made Sticky - fix [ 1471218 ] 6.8.8: Unable to change Default Home Page + - fix [ 1481787 ] autocomplete in user editing screens - fix [ 1445002 ] Field(s) fail to delete - fix [ 1344318 ] utf8 support for uri_escape/URL::Escape - fix [ 1466255 ] 6.8.8 Typo in package WebGUI::Operation::FormHelpers diff --git a/docs/credits.txt b/docs/credits.txt index 4c9847bc9..6cc333a4c 100644 --- a/docs/credits.txt +++ b/docs/credits.txt @@ -7,7 +7,8 @@ The following people/companies are responsible for WebGUI: WebGUI Core..........................JT Smith / Plain Black -Contributing Developers..............Peter Beardsley / Appropriate Solutions +Contributing Developers..............Lucas Bartholemy + Peter Beardsley / Appropriate Solutions Leendert Bottelberghs / United Knowledge Richard Caelius / 100 World Irving Carrion diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index 0e89c4a9b..9daa6db8b 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -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) { diff --git a/lib/WebGUI/Asset/Post.pm b/lib/WebGUI/Asset/Post.pm index b9462341b..1fb68156f 100644 --- a/lib/WebGUI/Asset/Post.pm +++ b/lib/WebGUI/Asset/Post.pm @@ -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 diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm index f69795932..5a47c3c68 100644 --- a/lib/WebGUI/Asset/Wobject/Collaboration.pm +++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm @@ -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;