From dc642f80ba9985d0069589946d49493423bef20c Mon Sep 17 00:00:00 2001 From: Martin Kamerbeek Date: Wed, 2 May 2007 12:04:15 +0000 Subject: [PATCH] Fixed Asset tree cut and paste not handled by search --- docs/changelog/7.x.x.txt | 4 +++- lib/WebGUI/AssetClipboard.pm | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index f78481d63..972ea4c4a 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -16,7 +16,9 @@ http://www.plainblack.com/bugs/tracker/unable-to-upload-new-file-to-update-contents-of-file-asset - fix: Issue calling shortcut - incorrect template (Martin Kamerbeek / Oqapi) http://www.plainblack.com/bugs/tracker/issue-calling-shortcut---incorrect-template - + - fix: Asset tree cut and paste not handled by search (Martin Kamerbeek / + Oqapi) + http://www.plainblack.com/bugs/tracker/asset-tree-cut-and-paste-not-handled-by-search 7.3.15 - Added more documentation to WebGUI.pm diff --git a/lib/WebGUI/AssetClipboard.pm b/lib/WebGUI/AssetClipboard.pm index 0133da317..02495c70a 100644 --- a/lib/WebGUI/AssetClipboard.pm +++ b/lib/WebGUI/AssetClipboard.pm @@ -154,14 +154,20 @@ sub paste { my $assetId = shift; my $pastedAsset = WebGUI::Asset->newByDynamicClass($self->session,$assetId); return 0 unless ($self->get("state") eq "published"); - # Don't allow a shortcut to create an endless loop + + # Don't allow a shortcut to create an endless loop return 0 if ($pastedAsset->get("className") eq "WebGUI::Asset::Shortcut" && $pastedAsset->get("shortcutToAssetId") eq $self->getId); if ($self->getId eq $pastedAsset->get("parentId") || $pastedAsset->setParent($self)) { $pastedAsset->publish(['clipboard','clipboard-limbo']); # Paste only clipboard items $pastedAsset->updateHistory("pasted to parent ".$self->getId); + + # Update lineage in search index. + $pastedAsset->indexContent(); + return 1; } - return 0; + + return 0; } #-------------------------------------------------------------------