From 6c24ea7aeb5a860a3f5ea9ffdabcc356747ecde8 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Thu, 19 Oct 2006 16:36:59 +0000 Subject: [PATCH] - Fixed a bug that caused workflows to fail if collaboration systems and posts for that CS were in the same version tag at commit time. --- docs/changelog/7.x.x.txt | 2 ++ lib/WebGUI/VersionTag.pm | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 659a624bd..4f9e921ff 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -2,6 +2,8 @@ - Added server side spellchecker (Martin Kamerbeek / Procolix) 7.1.2 + - Fixed a bug that caused workflows to fail if collaboration systems and + posts for that CS were in the same version tag at commit time. 7.1.1 diff --git a/lib/WebGUI/VersionTag.pm b/lib/WebGUI/VersionTag.pm index cc4ebcd27..8d8e7c89a 100644 --- a/lib/WebGUI/VersionTag.pm +++ b/lib/WebGUI/VersionTag.pm @@ -92,7 +92,7 @@ Commits all assets edited under a version tag, and then sets the version tag to sub commit { my $self = shift; - foreach my $asset (@{$self->getAssets({"reverse"=>1})}) { + foreach my $asset (@{$self->getAssets({"byLineage"=>1})}) { $asset->commit; } $self->{_data}{isCommitted} = 1; @@ -145,6 +145,10 @@ A hash reference containing options to change the output. A boolean that will reverse the order of the assets. The default is to return the assets in descending order. +=head4 byLineage + +A boolean that will return the asset list ordered by lineage, ascending. Cannot be used in conjunction with "reverse". + =cut sub getAssets { @@ -152,7 +156,12 @@ sub getAssets { my $options = shift; my @assets = (); my $direction = $options->{reverse} ? "asc" : "desc"; - 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=? order by revisionDate ".$direction, [$self->getId]); + my $sort = "revisionDate"; + if ($options->{byLineage}) { + $sort = "lineage"; + $direction = "asc"; + } + 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=? order by ".$sort." ".$direction, [$self->getId]); while (my ($id,$class,$version) = $sth->array) { push(@assets, WebGUI::Asset->new($self->session,$id,$class,$version)); }