From e9853fdf5c71c6b6a3de33d9ded00db3ca26eeb4 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Mon, 28 Apr 2008 23:53:08 +0000 Subject: [PATCH] hide default thing until there are things to list --- lib/WebGUI/Asset/Wobject/Thingy.pm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/WebGUI/Asset/Wobject/Thingy.pm b/lib/WebGUI/Asset/Wobject/Thingy.pm index b24f9c093..ba7fe6e34 100644 --- a/lib/WebGUI/Asset/Wobject/Thingy.pm +++ b/lib/WebGUI/Asset/Wobject/Thingy.pm @@ -526,12 +526,14 @@ sub getEditForm { my $things = $self->session->db->buildHashRef('select thingId, label from Thingy_things where assetId = ?',[$self->get("assetId")]); - $tabform->getTab("display")->selectBox( - -name=>"defaultThingId", - -value=>$self->get("defaultThingId"), - -label=>$i18n->get("default thing label"), - -options=>$things, - ); + unless (scalar(keys(%{$things}))) { + $tabform->getTab("display")->selectBox( + -name=>"defaultThingId", + -value=>$self->get("defaultThingId"), + -label=>$i18n->get("default thing label"), + -options=>$things, + ); + } return $tabform; }