diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 8157955b0..42cd94f02 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,4 +1,5 @@ 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 - fixed: ukplayer example is now loaded with swfobject.js released under the diff --git a/lib/WebGUI/AssetClipboard.pm b/lib/WebGUI/AssetClipboard.pm index 6805bc329..ead1afd09 100644 --- a/lib/WebGUI/AssetClipboard.pm +++ b/lib/WebGUI/AssetClipboard.pm @@ -261,11 +261,12 @@ sub www_copyList { =cut sub www_createShortcut { - my $self = shift; - return $self->session->privilege->insufficient() unless ($self->session->user->isInGroup(4)); + my $self = shift; + my $session = $self->session; + return $session->privilege->insufficient() unless ($self->session->user->isInGroup(4)); 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({ className=>'WebGUI::Asset::Shortcut', shortcutToAssetId=>$self->getId, @@ -283,11 +284,11 @@ sub www_createShortcut { if (! $isOnDashboard) { $child->cut; } - if (WebGUI::VersionTag->autoCommitWorkingIfEnabled($self->session, { + if (WebGUI::VersionTag->autoCommitWorkingIfEnabled($session, { allowComments => 1, returnUrl => $self->getUrl, - })) { - return undef; + }) eq 'redirect') { + return 'redirect'; }; if ($isOnDashboard) {