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."; }