Fix requestAutoCommit. All tests in t/Asset/Asset.t passing.
This commit is contained in:
parent
e5affbd0c2
commit
451eb33f0f
2 changed files with 9 additions and 9 deletions
|
|
@ -371,7 +371,7 @@ sub moveAssetToVersionTag {
|
||||||
#
|
#
|
||||||
my $moveToTagId = $moveToTag;
|
my $moveToTagId = $moveToTag;
|
||||||
if ( ref($moveToTag) eq "WebGUI::VersionTag" ) {
|
if ( ref($moveToTag) eq "WebGUI::VersionTag" ) {
|
||||||
$moveToTagId = $moveToTag->get('tagId');
|
$moveToTagId = $moveToTag->tagId;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$moveToTag = WebGUI::VersionTag->new( $self->session, $moveToTagId );
|
$moveToTag = WebGUI::VersionTag->new( $self->session, $moveToTagId );
|
||||||
|
|
@ -400,15 +400,15 @@ Requests an autocommit tag be commited. See also getAutoCommitWorkflowId() and s
|
||||||
sub requestAutoCommit {
|
sub requestAutoCommit {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
my $parentAsset;
|
my $parentAsset = eval { $self->getParent; };
|
||||||
if ( not defined( $parentAsset = $self->getParent ) ) {
|
if ( Exception::Class->caught() ) {
|
||||||
$parentAsset = WebGUI::Asset->newPending( $self->session, $self->get('parentId') );
|
$parentAsset = WebGUI::Asset->newPending( $self->session, $self->parentId );
|
||||||
}
|
}
|
||||||
unless ( $parentAsset->hasBeenCommitted ) {
|
unless ( $parentAsset->hasBeenCommitted ) {
|
||||||
my $tagId = $parentAsset->get('tagId');
|
my $tagId = $parentAsset->tagId;
|
||||||
|
|
||||||
if ($tagId) {
|
if ($tagId) {
|
||||||
if ( $tagId ne $self->get('tagId') ) {
|
if ( $tagId ne $self->tagId ) {
|
||||||
$self->moveAssetToVersionTag($tagId);
|
$self->moveAssetToVersionTag($tagId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -486,7 +486,7 @@ A new version tag id.
|
||||||
sub setVersionTag {
|
sub setVersionTag {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $tagId = shift;
|
my $tagId = shift;
|
||||||
$self->session->db->write("update assetData set tagId=? where assetId=? and tagId = ?", [$tagId, $self->getId,$self->get('tagId')]);
|
$self->session->db->write("update assetData set tagId=? where assetId=? and tagId = ?", [$tagId, $self->getId,$self->tagId]);
|
||||||
$self->tagId($tagId);
|
$self->tagId($tagId);
|
||||||
$self->updateHistory("changed version tag to $tagId");
|
$self->updateHistory("changed version tag to $tagId");
|
||||||
$self->purgeCache;
|
$self->purgeCache;
|
||||||
|
|
|
||||||
|
|
@ -666,8 +666,8 @@ $properties2 = {
|
||||||
url => 'moveVersionToParent_03',
|
url => 'moveVersionToParent_03',
|
||||||
};
|
};
|
||||||
|
|
||||||
my $childAsset = $parentAsset->addChild($properties, $properties2->{id});
|
my $childAsset = $parentAsset->addChild($properties, $properties2->{id});
|
||||||
my $testAsset = WebGUI::Asset->newPending($session, $childAsset->parentId);
|
my $testAsset = WebGUI::Asset->newPending($session, $childAsset->parentId);
|
||||||
my $testVersionTag = WebGUI::VersionTag->new($session, $testAsset->tagId);
|
my $testVersionTag = WebGUI::VersionTag->new($session, $testAsset->tagId);
|
||||||
|
|
||||||
my $childVersionTag;
|
my $childVersionTag;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue