diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index a7b8f472c..7d7a8d0e5 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -12,6 +12,7 @@ - fix: CS posts won't allow new attachments after deleting an old one - fix: SSL redirection broken - fix: Shortcut overrides not copied with asset or removed on purge + - fix: Copy operations create version tags even with auto-commit turned on 7.4.13 - fix: field_loop missing from SQL Form template diff --git a/lib/WebGUI/AssetClipboard.pm b/lib/WebGUI/AssetClipboard.pm index c7d8607ee..f1ea89351 100644 --- a/lib/WebGUI/AssetClipboard.pm +++ b/lib/WebGUI/AssetClipboard.pm @@ -183,25 +183,34 @@ Duplicates self, cuts duplicate, returns self->getContainer->www_view if canEdit =cut sub www_copy { - my $self = shift; - return $self->session->privilege->insufficient() unless $self->canEdit; + my $self = shift; + return $self->session->privilege->insufficient + unless $self->canEdit; - # with: 'children' || 'descendants' || '' - my $with = $self->session->form->get('with') || ''; - if ($with) { - my $childrenOnly = $with eq 'children'; - my $newAsset = $self->duplicateBranch($childrenOnly); - $newAsset->update({ title=>$self->getTitle.' (copy)'}); - $newAsset->cut; - return $self->session->asset($self->getContainer)->www_view; - } - else { - my $newAsset = $self->duplicate({skipAutoCommitWorkflows => 1}); - $newAsset->update({ title=>$self->getTitle.' (copy)'}); - $newAsset->cut; - return $self->session->asset($self->getContainer)->www_view; + # with: 'children' || 'descendants' || '' + my $with = $self->session->form->get('with') || ''; + my $newAsset; + if ($with) { + my $childrenOnly = $with eq 'children'; + $newAsset = $self->duplicateBranch($childrenOnly); + } + else { + $newAsset = $self->duplicate({skipAutoCommitWorkflows => 1}); + } + $newAsset->update({ title=>$self->getTitle.' (copy)'}); + $newAsset->cut; + if ($self->session->setting->get("autoRequestCommit")) { + if ($self->session->setting->get("skipCommitComments")) { + WebGUI::VersionTag->getWorking($self->session)->requestCommit; + } else { + $self->session->http->setRedirect($self->getUrl( + "op=commitVersionTag;tagId=".WebGUI::VersionTag->getWorking($self->session)->getId + )); + return 1; } + } + return $self->session->asset($self->getContainer)->www_view; } #-------------------------------------------------------------------