Fixed Asset tree cut and paste not handled by search

This commit is contained in:
Martin Kamerbeek 2007-05-02 12:04:15 +00:00
parent 61641c404b
commit dc642f80ba
2 changed files with 11 additions and 3 deletions

View file

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

View file

@ -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;
}
#-------------------------------------------------------------------