diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 7f90d98ce..d1728a8c3 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -65,6 +65,8 @@ - WebGUI::Session::Scratch->delete now returns the value deleted for convenience, like Perl's built-in delete() function. - fix: Auth redirectOnLogin wouldn't work if login called from Operation::execute() + - fix: Uncommitted Collaborations and adding threads + 7.1.3 - fix: SQLReport now returns error if can't find DatabaseLink diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm index 6203ad8e2..22f92b019 100644 --- a/lib/WebGUI/Asset/Wobject/Collaboration.pm +++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm @@ -221,7 +221,7 @@ sub canPost { return ( ( $self->get("status") eq "approved" || - $self->getRevisionCount > 1 + $self->getTagCount > 1 # checks to make sure that the cs has been committed at least once ) && ( $self->session->user->isInGroup($self->get("postGroupId")) || $self->SUPER::canEdit diff --git a/lib/WebGUI/VersionTag.pm b/lib/WebGUI/VersionTag.pm index 8d8e7c89a..d6cb447e0 100644 --- a/lib/WebGUI/VersionTag.pm +++ b/lib/WebGUI/VersionTag.pm @@ -204,13 +204,27 @@ sub getOpenTags { =head2 getRevisionCount ( ) -Returns the number of revisions that are under this tag. +Returns the number of revisions for this asset. =cut sub getRevisionCount { my $self = shift; - my ($count) = $self->session->db->quickArray("select count(assetId) from assetData where tagId=?", [$self->getId]); + my ($count) = $self->session->db->quickArray("select count(*) from assetData where assetId=?", [$self->getId]); + return $count; +} + +#------------------------------------------------------------------- + +=head2 getTagCount ( ) + +Returns the number of tags that have been attached to this asset. Think of it sort of like an absolute revision count, rather than counting the number of actual edits, we're counting the number of tags opened against this asset to be edited. + +=cut + +sub getTagCount { + my $self = shift; + my ($count) = $self->session->db->quickArray("select count(distinct(tagId)) from assetData where assetId=?", [$self->getId]); return $count; }