diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 3d0c294ef..4f87993bc 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -11,6 +11,7 @@ - fixed #11992: html source editor - fixed #12100: Carousel and/or RichEdit - fixed #12103: PayPalStd driver fails occasionally + - rfe #12105: Make shortcuts related for export purposes 7.10.13 - added #12079: Carousel Auto Play diff --git a/lib/WebGUI/AssetExportHtml.pm b/lib/WebGUI/AssetExportHtml.pm index 2387a5992..6db3b6ae7 100644 --- a/lib/WebGUI/AssetExportHtml.pm +++ b/lib/WebGUI/AssetExportHtml.pm @@ -623,7 +623,7 @@ sub exportGetDescendants { =head2 exportGetRelatedAssetIds -Normally the empty arrayref, but override if exporting your asset would +Normally all an asset's shorcuts, but override if exporting your asset would invalidate other exported assets. If exportRelated is checked, this will be called and any assetIds it returns will be exported when your asset is exported. @@ -635,7 +635,10 @@ related, exporting anything would export everything. =cut -sub exportGetRelatedAssetIds { [] } +sub exportGetRelatedAssetIds { + my $self = shift; + WebGUI::Asset::Shortcut->getShortcutsForAssetId($self->session, $self->getId); +} #------------------------------------------------------------------- diff --git a/t/Asset/Shortcut/010-linked-asset.t b/t/Asset/Shortcut/010-linked-asset.t index 6c061fb4e..58f1c9379 100644 --- a/t/Asset/Shortcut/010-linked-asset.t +++ b/t/Asset/Shortcut/010-linked-asset.t @@ -33,7 +33,7 @@ init(); #---------------------------------------------------------------------------- # Tests -plan tests => 11; +plan tests => 12; #---------------------------------------------------------------------------- # Test shortcut's link to original asset @@ -54,6 +54,12 @@ is( "Original assetId is correct" ); +is_deeply( + [ $shortcut->getId ], + $original->exportGetRelatedAssetIds, + 'shortcut is related for the purpose of exports', +); + #---------------------------------------------------------------------------- # Test trashing snippet trashes shortcut also $snippet->trash;