- 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.
This commit is contained in:
JT Smith 2006-10-19 16:36:59 +00:00
parent 9f232b4049
commit 6c24ea7aeb
2 changed files with 13 additions and 2 deletions

View file

@ -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

View file

@ -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));
}