From 7f37c200285a39e2901f485c832a1c0cade1b199 Mon Sep 17 00:00:00 2001 From: Chris Nehren Date: Thu, 8 Nov 2007 19:33:57 +0000 Subject: [PATCH] Gr. One more attempt at getting the default to work properly. --- lib/WebGUI/Asset/Wobject/Collaboration.pm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm index 396f67877..d3a1fca45 100644 --- a/lib/WebGUI/Asset/Wobject/Collaboration.pm +++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm @@ -362,6 +362,18 @@ sub definition { my $i18n = WebGUI::International->new($session,"Asset_Collaboration"); my $useKarma = $session->setting->get('useKarma'); + # obtain the groupIdEdit default value. Try to get it from the parent asset + # if it exists. If not, default to the value specified in WebGUI::Asset's + # definition. + my $groupIdEdit; + if($session->asset) { + $groupIdEdit = $session->asset->get('groupIdEdit'); + } + else { + $groupIdEdit = '4'; + } + + my %sortByOptions; tie %sortByOptions, 'Tie::IxHash'; %sortByOptions = (lineage=>$i18n->get('sequence'), @@ -742,7 +754,7 @@ sub definition { uiLevel=>6, fieldType=>'group', filter=>'fixId', - defaultValue=>$session->asset->get('groupIdEdit') || '4', + defaultValue=>$groupIdEdit, # groupToEditPost should default to groupIdEdit }, );