rfe #12105: Make shortcuts related for export purposes

This commit is contained in:
Paul Driver 2011-04-13 15:57:50 -05:00
parent c015b6710c
commit df2e1a5b27
3 changed files with 13 additions and 3 deletions

View file

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

View file

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

View file

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