fix some issues with autocommit
This commit is contained in:
parent
d0c9f86504
commit
26790fd1dd
8 changed files with 12 additions and 11 deletions
|
|
@ -2559,7 +2559,7 @@ sub www_editSave {
|
|||
override => scalar $self->session->form->process('saveAndCommit'),
|
||||
allowComments => 1,
|
||||
returnUrl => $self->getUrl,
|
||||
})) {
|
||||
}) eq 'redirect') {
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ sub editSave {
|
|||
override => scalar $self->session->form->process("saveAndCommit"),
|
||||
allowComments => 1,
|
||||
returnUrl => $self->getUrl,
|
||||
})) {
|
||||
}) eq 'redirect') {
|
||||
return undef;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -388,7 +388,7 @@ sub www_importProducts {
|
|||
if (WebGUI::VersionTag->autoCommitWorkingIfEnabled($self->session, {
|
||||
allowComments => 1,
|
||||
returnUrl => $self->getUrl,
|
||||
})) {
|
||||
}) eq 'redirect') {
|
||||
return undef;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ sub www_editBranchSave {
|
|||
if (WebGUI::VersionTag->autoCommitWorkingIfEnabled($self->session, {
|
||||
allowComments => 1,
|
||||
returnUrl => $self->getUrl,
|
||||
})) {
|
||||
}) eq 'redirect') {
|
||||
return undef;
|
||||
};
|
||||
delete $self->{_parent};
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ sub www_copy {
|
|||
if (WebGUI::VersionTag->autoCommitWorkingIfEnabled($self->session, {
|
||||
allowComments => 1,
|
||||
returnUrl => $self->getUrl,
|
||||
})) {
|
||||
}) eq 'redirect') {
|
||||
return undef;
|
||||
};
|
||||
return $self->session->asset($self->getContainer)->www_view;
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ sub www_importPackage {
|
|||
if (WebGUI::VersionTag->autoCommitWorkingIfEnabled($self->session, {
|
||||
allowComments => 1,
|
||||
returnUrl => $self->getUrl,
|
||||
})) {
|
||||
}) eq 'redirect') {
|
||||
return undef;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -375,7 +375,7 @@ sub www_manage {
|
|||
if (WebGUI::VersionTag->autoCommitWorkingIfEnabled($session, {
|
||||
allowComments => 1,
|
||||
returnUrl => $currentAsset->getUrl,
|
||||
})) {
|
||||
}) eq 'redirect' ) {
|
||||
return undef;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,8 @@ These methods are available from this class:
|
|||
=head2 autoCommitWorkingIfEnabled ( $session, $options )
|
||||
|
||||
A class method that automatically commits the working version tag if auto commit is
|
||||
enabled. Returns true if the version tag was committed.
|
||||
enabled. Returns 'commit' if the tag was committed, 'redirect' if a redirect for
|
||||
comments was set (only possible with allowComments), or false if no action was taken.
|
||||
|
||||
=head3 $options
|
||||
|
||||
|
|
@ -70,7 +71,7 @@ sub autoCommitWorkingIfEnabled {
|
|||
my $options = shift || {};
|
||||
# need a version tag to do any auto commit
|
||||
my $versionTag = $class->getWorking($session, "nocreate");
|
||||
return
|
||||
return undef
|
||||
unless $versionTag;
|
||||
# auto commit assets
|
||||
# save and commit button and site wide auto commit work the same
|
||||
|
|
@ -80,13 +81,13 @@ sub autoCommitWorkingIfEnabled {
|
|||
) {
|
||||
if ($session->setting->get("skipCommitComments") || !$options->{allowComments}) {
|
||||
$versionTag->requestCommit;
|
||||
return 1;
|
||||
return 'commit';
|
||||
}
|
||||
else {
|
||||
my $url = $options->{returnUrl} || $session->url->page;
|
||||
$url = $session->url->append($url, "op=commitVersionTag;tagId=" . $versionTag->getId);
|
||||
$session->http->setRedirect($url);
|
||||
return 1;
|
||||
return 'redirect';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue