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

View file

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