fix: Copy operations create version tags even with auto-commit turned on

This commit is contained in:
Graham Knop 2007-11-15 08:23:54 +00:00
parent b725e93f35
commit d42f568456
2 changed files with 26 additions and 16 deletions

View file

@ -12,6 +12,7 @@
- fix: CS posts won't allow new attachments after deleting an old one - fix: CS posts won't allow new attachments after deleting an old one
- fix: SSL redirection broken - fix: SSL redirection broken
- fix: Shortcut overrides not copied with asset or removed on purge - 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 7.4.13
- fix: field_loop missing from SQL Form template - fix: field_loop missing from SQL Form template

View file

@ -183,25 +183,34 @@ Duplicates self, cuts duplicate, returns self->getContainer->www_view if canEdit
=cut =cut
sub www_copy { sub www_copy {
my $self = shift; my $self = shift;
return $self->session->privilege->insufficient() unless $self->canEdit; return $self->session->privilege->insufficient
unless $self->canEdit;
# with: 'children' || 'descendants' || ''
my $with = $self->session->form->get('with') || '';
if ($with) { # with: 'children' || 'descendants' || ''
my $childrenOnly = $with eq 'children'; my $with = $self->session->form->get('with') || '';
my $newAsset = $self->duplicateBranch($childrenOnly); my $newAsset;
$newAsset->update({ title=>$self->getTitle.' (copy)'}); if ($with) {
$newAsset->cut; my $childrenOnly = $with eq 'children';
return $self->session->asset($self->getContainer)->www_view; $newAsset = $self->duplicateBranch($childrenOnly);
} }
else { else {
my $newAsset = $self->duplicate({skipAutoCommitWorkflows => 1}); $newAsset = $self->duplicate({skipAutoCommitWorkflows => 1});
$newAsset->update({ title=>$self->getTitle.' (copy)'}); }
$newAsset->cut; $newAsset->update({ title=>$self->getTitle.' (copy)'});
return $self->session->asset($self->getContainer)->www_view; $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;
} }
#------------------------------------------------------------------- #-------------------------------------------------------------------