From 0bfc16bf9aea73b859ebb300ef219ab988faa01b Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 6 Aug 2009 17:56:56 +0000 Subject: [PATCH] Forward porting viewing pending assets in the trash and clipboard. Also allowing restore of pending assets in the trash. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset.pm | 12 ++++++++++-- lib/WebGUI/AssetTrash.pm | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index e2786e253..237e40bf7 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,5 +1,6 @@ 7.7.17 - fixed #10724: gotcha.txt for 7.7.17 enhanced + - fixed #10316: Cannot view pending version tags - fixed #10667: cannot change size of template editor - fixed #10654: Story Archive: Search not working properly - fixed #10692: Unprivileged users can stop spectre diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index 5918fd158..8702b1461 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -311,12 +311,20 @@ sub checkView { return "chunked"; } elsif ($var->isAdminOn && $self->get("state") =~ /^trash/) { # show em trash - $http->setRedirect($self->getUrl("func=manageTrash")); + my $queryFrag = "func=manageTrash"; + if ($self->session->form->process('revision')) { + $queryFrag .= ";revision=".$self->session->form->process('revision'); + } + $http->setRedirect($self->getUrl($queryFrag)); $http->sendHeader; return "chunked"; } elsif ($var->isAdminOn && $self->get("state") =~ /^clipboard/) { # show em clipboard - $http->setRedirect($self->getUrl("func=manageClipboard")); + my $queryFrag = "func=manageTrash"; + if ($self->session->form->process('revision')) { + $queryFrag .= ";revision=".$self->session->form->process('revision'); + } + $http->setRedirect($self->getUrl($queryFrag)); $http->sendHeader; return "chunked"; } diff --git a/lib/WebGUI/AssetTrash.pm b/lib/WebGUI/AssetTrash.pm index f02570e38..a8fd9baef 100644 --- a/lib/WebGUI/AssetTrash.pm +++ b/lib/WebGUI/AssetTrash.pm @@ -473,7 +473,7 @@ Restores a piece of content from the trash back to it's original location. sub www_restoreList { my $self = shift; foreach my $id ($self->session->form->param("assetId")) { - my $asset = WebGUI::Asset->newByDynamicClass($self->session,$id); + my $asset = eval { WebGUI::Asset->newPending($self->session,$id); }; $asset->publish if $asset->canEdit; } if ($self->session->form->process("proceed") ne "") {