fix: importPackage now allows you to skip site's autocommit settings. This is necessary for upgrades.
Upgrades were fixed to use the new options
This commit is contained in:
parent
e5ca1aa00d
commit
439fbce173
5 changed files with 21 additions and 7 deletions
|
|
@ -34,6 +34,8 @@
|
||||||
- fix: Couldn't add single photos to gallery.
|
- fix: Couldn't add single photos to gallery.
|
||||||
- fix: Make the Owner in editBranch to be the same as addEdit, allowing
|
- fix: Make the Owner in editBranch to be the same as addEdit, allowing
|
||||||
any user to be selected (perlDreamer Consulting, LLC.)
|
any user to be selected (perlDreamer Consulting, LLC.)
|
||||||
|
- Added a simple SMTPD for use in testing (t/smtpd.pl)
|
||||||
|
- importPackage can now skip autocommit functions in the site settings
|
||||||
|
|
||||||
7.5.0
|
7.5.0
|
||||||
- rfe: Search Asset returns URLs
|
- rfe: Search Asset returns URLs
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ sub addPackage {
|
||||||
$storage->addFileFromFilesystem( $file );
|
$storage->addFileFromFilesystem( $file );
|
||||||
|
|
||||||
# Import the package into the import node
|
# Import the package into the import node
|
||||||
my $package = WebGUI::Asset->getImportNode($session)->importPackage( $storage );
|
my $package = WebGUI::Asset->getImportNode($session)->importPackage( $storage, { skipAutoCommit => 1 } );
|
||||||
|
|
||||||
# Make the package not a package anymore
|
# Make the package not a package anymore
|
||||||
$package->update({ isPackage => 0 });
|
$package->update({ isPackage => 0 });
|
||||||
|
|
|
||||||
|
|
@ -536,7 +536,7 @@ sub addPackage {
|
||||||
$storage->addFileFromFilesystem( $file );
|
$storage->addFileFromFilesystem( $file );
|
||||||
|
|
||||||
# Import the package into the import node
|
# Import the package into the import node
|
||||||
my $package = WebGUI::Asset->getImportNode($session)->importPackage( $storage );
|
my $package = WebGUI::Asset->getImportNode($session)->importPackage( $storage, { skipAutoCommit => 0 } );
|
||||||
|
|
||||||
# Make the package not a package anymore
|
# Make the package not a package anymore
|
||||||
$package->update({ isPackage => 0 });
|
$package->update({ isPackage => 0 });
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ sub addPackage {
|
||||||
$storage->addFileFromFilesystem( $file );
|
$storage->addFileFromFilesystem( $file );
|
||||||
|
|
||||||
# Import the package into the import node
|
# Import the package into the import node
|
||||||
my $package = WebGUI::Asset->getImportNode($session)->importPackage( $storage );
|
my $package = WebGUI::Asset->getImportNode($session)->importPackage( $storage, { skipAutoCommit => 0 } );
|
||||||
|
|
||||||
# Make the package not a package anymore
|
# Make the package not a package anymore
|
||||||
$package->update({ isPackage => 0 });
|
$package->update({ isPackage => 0 });
|
||||||
|
|
|
||||||
|
|
@ -116,9 +116,13 @@ sub getPackageList {
|
||||||
|
|
||||||
=head2 importAssetData ( hashRef )
|
=head2 importAssetData ( hashRef )
|
||||||
|
|
||||||
Imports the data exported by the exportAssetData method. If the asset already exists, a new revision will be created with these properties. If it doesn't exist then a child will be added to the current asset. Returns a reference to the created asset.
|
Imports the data exported by the exportAssetData method. If the asset
|
||||||
|
already exists, a new revision will be created with these properties. If it
|
||||||
|
doesn't exist then a child will be added to the current asset.
|
||||||
|
|
||||||
=head3 hashRef
|
Returns a reference to the created asset.
|
||||||
|
|
||||||
|
=head3 assetData
|
||||||
|
|
||||||
A hash reference containing the exported data.
|
A hash reference containing the exported data.
|
||||||
|
|
||||||
|
|
@ -187,7 +191,7 @@ sub importAssetCollateralData {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 importPackage ( storageLocation )
|
=head2 importPackage ( storageLocation [, options] )
|
||||||
|
|
||||||
Imports the data from a webgui package file.
|
Imports the data from a webgui package file.
|
||||||
|
|
||||||
|
|
@ -195,11 +199,19 @@ Imports the data from a webgui package file.
|
||||||
|
|
||||||
A reference to a WebGUI::Storage object that contains a webgui package file.
|
A reference to a WebGUI::Storage object that contains a webgui package file.
|
||||||
|
|
||||||
|
=head3 options
|
||||||
|
|
||||||
|
An optional hashref of options with the following possible keys:
|
||||||
|
|
||||||
|
skipAutoCommit : If true, will skip any automatic commit in
|
||||||
|
the site's settings.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub importPackage {
|
sub importPackage {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $storage = shift;
|
my $storage = shift;
|
||||||
|
my $options = shift;
|
||||||
my $decompressed = $storage->untar($storage->getFiles->[0]);
|
my $decompressed = $storage->untar($storage->getFiles->[0]);
|
||||||
my %assets = (); # All the assets we've imported
|
my %assets = (); # All the assets we've imported
|
||||||
my $package = undef; # The asset package
|
my $package = undef; # The asset package
|
||||||
|
|
@ -232,7 +244,7 @@ sub importPackage {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Handle autocommit workflows
|
# Handle autocommit workflows
|
||||||
if ($self->session->setting->get("autoRequestCommit")) {
|
if (!$options->{skipAutoCommit} && $self->session->setting->get("autoRequestCommit")) {
|
||||||
if ($self->session->setting->get("skipCommitComments")) {
|
if ($self->session->setting->get("skipCommitComments")) {
|
||||||
WebGUI::VersionTag->getWorking($self->session)->requestCommit;
|
WebGUI::VersionTag->getWorking($self->session)->requestCommit;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue