From bfedba82dd0120669d955c8ce2b968f7c461b448 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 20 Jan 2010 20:15:46 -0800 Subject: [PATCH] Convert VersionTag to use newById instead of new, since new cannot dispatch to any class but the one that invoked it. --- lib/WebGUI/VersionTag.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/WebGUI/VersionTag.pm b/lib/WebGUI/VersionTag.pm index 2ddc5d10b..669ab4a99 100644 --- a/lib/WebGUI/VersionTag.pm +++ b/lib/WebGUI/VersionTag.pm @@ -308,11 +308,11 @@ sub getAssets { if ($options->{onlyPending}) { $pending = " and assetData.status='pending' "; } - my $sth = $self->session->db->read("select asset.assetId,asset.className,assetData.revisionDate from assetData left join asset on asset.assetId=assetData.assetId where assetData.tagId=? ".$pending." order by ".$sort." ".$direction, [$self->getId]); - while (my ($id,$class,$version) = $sth->array) { - my $asset = WebGUI::Asset->new($self->session,$id,$class,$version); + my $sth = $self->session->db->read("select asset.assetId,assetData.revisionDate from assetData left join asset on asset.assetId=assetData.assetId where assetData.tagId=? ".$pending." order by ".$sort." ".$direction, [$self->getId]); + while (my ($id,$version) = $sth->array) { + my $asset = WebGUI::Asset->newById($self->session,$id,$version); unless (defined $asset) { - $self->session->errorHandler->error("Asset $id $class $version could not be instanciated by version tag ".$self->getId.". Perhaps it is corrupt."); + $self->session->errorHandler->error("Asset $id $version could not be instanciated by version tag ".$self->getId.". Perhaps it is corrupt."); next; } push(@assets, $asset);