From 936cd1a7ef2b6328ed55a8d7150e5abf7dffbaf7 Mon Sep 17 00:00:00 2001 From: Matthew Wilson Date: Mon, 17 Oct 2005 17:39:51 +0000 Subject: [PATCH] cleaning up --- lib/WebGUI/Macro/RandomAssetProxy.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Macro/RandomAssetProxy.pm b/lib/WebGUI/Macro/RandomAssetProxy.pm index ffb116c30..f693ce577 100644 --- a/lib/WebGUI/Macro/RandomAssetProxy.pm +++ b/lib/WebGUI/Macro/RandomAssetProxy.pm @@ -23,11 +23,12 @@ sub process { my $children = $asset->getLineage(["children"]); #randomize; srand; - my $randomAssetId = $children->[rand(scalar(@{$children}))]; + WebGUI::ErrorHandler::warn(rand(scalar(@{$children}))); + my $randomAssetId = $children->[$index1]; my $randomAsset = WebGUI::Asset->newByDynamicClass($randomAssetId); if (defined $randomAsset) { $randomAsset->toggleToolbar; - return $randomAsset->canView ? $randomAsset->view : undef; + return $randomAsset->canView ? $randomAsset->view() : undef; } else { return "Asset has no children."; }