fixed: errors on package importing are always reported as corrupted packages
This commit is contained in:
parent
48d5d544eb
commit
d3b85ef723
4 changed files with 19 additions and 5 deletions
|
|
@ -10,6 +10,7 @@
|
|||
- fixed: Matrix assets show pending listings from all matrix assets on a site
|
||||
- fixed: Changing name of Matrix listing leaves discussion forum with old name
|
||||
- fixed: Importing a package can break when updating a pending asset
|
||||
- fixed: errors on package importing are always reported as corrupted packages
|
||||
|
||||
7.5.7
|
||||
- fixed: HttpProxy mixes original site's content encoding with WebGUI's
|
||||
|
|
|
|||
|
|
@ -203,6 +203,8 @@ sub importPackage {
|
|||
my $self = shift;
|
||||
my $storage = shift;
|
||||
my $decompressed = $storage->untar($storage->getFiles->[0]);
|
||||
return undef
|
||||
if $storage->getErrorCount;
|
||||
my %assets = (); # All the assets we've imported
|
||||
my $package = undef; # The asset package
|
||||
my $error = $self->session->errorHandler;
|
||||
|
|
@ -226,15 +228,16 @@ sub importPackage {
|
|||
my $newAsset = $asset->importAssetData($data);
|
||||
$newAsset->importAssetCollateralData($data);
|
||||
$assets{$newAsset->getId} = $newAsset;
|
||||
|
||||
# First imported asset must be the "package"
|
||||
|
||||
unless ($package) {
|
||||
$package = $newAsset;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $package;
|
||||
return $package
|
||||
if $package;
|
||||
return 'corrupt';
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -307,7 +310,12 @@ sub www_importPackage {
|
|||
}
|
||||
if (!blessed $error) {
|
||||
my $i18n = WebGUI::International->new($self->session, "Asset");
|
||||
return $self->session->style->userStyle($i18n->get("package corrupt"));
|
||||
if ($error eq 'corrupt') {
|
||||
return $self->session->style->userStyle($i18n->get("package corrupt"));
|
||||
}
|
||||
else {
|
||||
return $self->session->style->userStyle($i18n->get("package extract error"));
|
||||
}
|
||||
}
|
||||
# Handle autocommit workflows
|
||||
if ($self->session->setting->get("autoRequestCommit")) {
|
||||
|
|
|
|||
|
|
@ -467,7 +467,7 @@ sub createTemp {
|
|||
}
|
||||
|
||||
$id =~ m/^(.{2})/;
|
||||
my $self = {_session=>$session, _id => $guid, _part1 => 'temp', _part2 => $1};
|
||||
my $self = {_session=>$session, _id => $guid, _part1 => 'temp', _part2 => $1, _errors => []};
|
||||
bless $self, ref($class)||$class;
|
||||
$self->_makePath;
|
||||
return $self;
|
||||
|
|
|
|||
|
|
@ -26,6 +26,11 @@ our $I18N = {
|
|||
context => q|the question asked of the admin when they click on a missing page|
|
||||
},
|
||||
|
||||
'package extract error' => {
|
||||
message => q|Unable to extract package! The package may be corrupt, or there may be a server error preventing packages from being imported.|,
|
||||
lastUpdated => 1206050885,
|
||||
},
|
||||
|
||||
'package corrupt' => {
|
||||
message => q|The package you tried to import appears to be corrupt. We imported up to the point where we detected corruption. If you won't want this portion, roll back your current version tag.|,
|
||||
lastUpdated => 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue