Prevent redirects from happening when cutting images and files.
This commit is contained in:
parent
3e0f449c46
commit
b4db7e4391
2 changed files with 8 additions and 6 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
7.6.10
|
7.6.10
|
||||||
|
- fixed: With autocommit and no comments on, making a shortcut of an asset takes you to that asset's view.
|
||||||
|
|
||||||
7.6.9
|
7.6.9
|
||||||
- fixed: ukplayer example is now loaded with swfobject.js released under the
|
- fixed: ukplayer example is now loaded with swfobject.js released under the
|
||||||
|
|
|
||||||
|
|
@ -261,11 +261,12 @@ sub www_copyList {
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub www_createShortcut {
|
sub www_createShortcut {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
return $self->session->privilege->insufficient() unless ($self->session->user->isInGroup(4));
|
my $session = $self->session;
|
||||||
|
return $session->privilege->insufficient() unless ($self->session->user->isInGroup(4));
|
||||||
my $isOnDashboard = $self->getParent->isa('WebGUI::Asset::Wobject::Dashboard');
|
my $isOnDashboard = $self->getParent->isa('WebGUI::Asset::Wobject::Dashboard');
|
||||||
|
|
||||||
my $shortcutParent = $isOnDashboard? $self->getParent : WebGUI::Asset->getImportNode($self->session);
|
my $shortcutParent = $isOnDashboard? $self->getParent : WebGUI::Asset->getImportNode($session);
|
||||||
my $child = $shortcutParent->addChild({
|
my $child = $shortcutParent->addChild({
|
||||||
className=>'WebGUI::Asset::Shortcut',
|
className=>'WebGUI::Asset::Shortcut',
|
||||||
shortcutToAssetId=>$self->getId,
|
shortcutToAssetId=>$self->getId,
|
||||||
|
|
@ -283,11 +284,11 @@ sub www_createShortcut {
|
||||||
if (! $isOnDashboard) {
|
if (! $isOnDashboard) {
|
||||||
$child->cut;
|
$child->cut;
|
||||||
}
|
}
|
||||||
if (WebGUI::VersionTag->autoCommitWorkingIfEnabled($self->session, {
|
if (WebGUI::VersionTag->autoCommitWorkingIfEnabled($session, {
|
||||||
allowComments => 1,
|
allowComments => 1,
|
||||||
returnUrl => $self->getUrl,
|
returnUrl => $self->getUrl,
|
||||||
})) {
|
}) eq 'redirect') {
|
||||||
return undef;
|
return 'redirect';
|
||||||
};
|
};
|
||||||
|
|
||||||
if ($isOnDashboard) {
|
if ($isOnDashboard) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue