fixes for weaken and iterator
This commit is contained in:
parent
60cefb3102
commit
247c607393
22 changed files with 83 additions and 47 deletions
|
|
@ -63,8 +63,15 @@ Turns this package into a package file and returns the storage location object o
|
|||
sub exportPackage {
|
||||
my $self = shift;
|
||||
my $storage = WebGUI::Storage->createTemp($self->session);
|
||||
my $assets = $self->getLineage(["self","descendants"],{statusToInclude=>['approved', 'archived']})
|
||||
while ( my $asset = $assets->() ) {
|
||||
my $assetIter = $self->getLineageIterator(["self","descendants"],{statusToInclude=>['approved', 'archived']});
|
||||
while ( 1 ) {
|
||||
my $asset;
|
||||
eval { $asset = $assetIter->() };
|
||||
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
|
||||
$self->session->log->error($x->full_message);
|
||||
next;
|
||||
}
|
||||
last unless $asset;
|
||||
my $data = $asset->exportAssetData;
|
||||
$storage->addFileFromScalar($data->{properties}{lineage}.".json", JSON->new->utf8->pretty->encode($data));
|
||||
foreach my $storageId (@{$data->{storage}}) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue