more bug fixes

This commit is contained in:
JT Smith 2005-02-18 01:04:05 +00:00
parent 09abb2d440
commit 9238c028c6
8 changed files with 37 additions and 14 deletions

View file

@ -21,11 +21,12 @@ sub process {
my $asset = WebGUI::Asset->newByUrl($url);
if (defined $asset) {
my $children = $asset->getLineage(["children"]);
randomize;
my $randomAssetId = $children->[rand(scalar(@{$children})];
#randomize;
my $randomAssetId = $children->[rand(scalar(@{$children}))];
my $randomAsset = WebGUI::Asset->newByDynamicClass($randomAssetId);
if (defined $randomAsset) {
return $randomAsset->canView ? $randomAsset->view : "";
$randomAsset->toggleToolbar;
return $randomAsset->canView ? $randomAsset->view : undef;
} else {
return "Asset has no children.";
}