diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 5ffc026b5..46074c857 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -6,6 +6,8 @@ - fix: Add event does not work WebGUI 7.0.5 in combination with Proxy Caching turned off (Wouter van Oijen / ProcoliX) - When going to an image by it's webgui url in admin mode, you are now shown the image instead of being taken to the edit screen for the image. + - fixed a bug in the Layout Asset where the asset would not inherit the + Layout template of its parent on addition (Martin Kamerbeek / Procolix) 7.0.6 - fix: Error in DateTime.pm diff --git a/lib/WebGUI/Asset/Wobject/Layout.pm b/lib/WebGUI/Asset/Wobject/Layout.pm index 63d9f1403..e330aa23a 100644 --- a/lib/WebGUI/Asset/Wobject/Layout.pm +++ b/lib/WebGUI/Asset/Wobject/Layout.pm @@ -97,8 +97,15 @@ sub getEditForm { my $self = shift; my $tabform = $self->SUPER::getEditForm(); my $i18n = WebGUI::International->new($self->session,"Asset_Layout"); + + my ($templateId); + if (($self->get("assetId") eq "new") && ($self->getParent->get('className') eq 'WebGUI::Asset::Wobject::Layout')) { + $templateId = $self->getParent->getValue('templateId'); + } else { + $templateId = $self->getValue('templateId'); + } $tabform->getTab("display")->template( - -value=>$self->getValue('templateId'), + -value=>$templateId, -label=>$i18n->get('layout template title'), -hoverHelp=>$i18n->get('template description'), -namespace=>"Layout"