From 0ffb28436ba624539334c8f34819bb924c328f84 Mon Sep 17 00:00:00 2001 From: Drake Date: Tue, 7 Nov 2006 15:52:25 +0000 Subject: [PATCH] Fix inability to create shortcuts to threads. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/AssetClipboard.pm | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index d8345a867..fde947568 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -25,6 +25,7 @@ - fix: editing posts loses changes in preview - change: Asset::getContainer no longer changes the session asset - fix: Survey numeric multiple choice options + - fix: inability to create shortcuts to threads 7.1.4 - Template variables in the main Survey Template were out of date in the diff --git a/lib/WebGUI/AssetClipboard.pm b/lib/WebGUI/AssetClipboard.pm index 0be20544b..7a5cdda27 100644 --- a/lib/WebGUI/AssetClipboard.pm +++ b/lib/WebGUI/AssetClipboard.pm @@ -207,8 +207,10 @@ sub www_copyList { sub www_createShortcut { my $self = shift; return $self->session->privilege->insufficient() unless ($self->session->user->isInGroup(4)); - my $isOnDashboard = ref $self->getParent eq 'WebGUI::Asset::Wobject::Dashboard'; - my $child = $self->getParent->addChild({ + my $isOnDashboard = $self->getParent->isa('WebGUI::Asset::Wobject::Dashboard'); + + my $shortcutParent = $isOnDashboard? $self->getParent : WebGUI::Asset->getImportNode($self->session); + my $child = $shortcutParent->addChild({ className=>'WebGUI::Asset::Shortcut', shortcutToAssetId=>$self->getId, title=>$self->getTitle, @@ -221,6 +223,7 @@ sub www_createShortcut { url=>$self->get("title"), templateId=>'PBtmpl0000000000000140' }); + if ($isOnDashboard) { return $self->getParent->www_view; } else {