Prevent redirects from happening when cutting images and files.

This commit is contained in:
Colin Kuskie 2009-01-22 21:22:55 +00:00
parent 3e0f449c46
commit b4db7e4391
2 changed files with 8 additions and 6 deletions

View file

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

View file

@ -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) {