diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 9d8c24146..50619b91e 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -34,6 +34,8 @@ - fix: Couldn't add single photos to gallery. - fix: Make the Owner in editBranch to be the same as addEdit, allowing 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 - rfe: Search Asset returns URLs diff --git a/docs/upgrades/_upgrade.skeleton b/docs/upgrades/_upgrade.skeleton index 0d47257e5..d9dced0ed 100644 --- a/docs/upgrades/_upgrade.skeleton +++ b/docs/upgrades/_upgrade.skeleton @@ -48,7 +48,7 @@ sub addPackage { $storage->addFileFromFilesystem( $file ); # 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 $package->update({ isPackage => 0 }); diff --git a/docs/upgrades/upgrade_7.4.21-7.5.0.pl b/docs/upgrades/upgrade_7.4.21-7.5.0.pl index c3fe2a8a8..8f851f16d 100644 --- a/docs/upgrades/upgrade_7.4.21-7.5.0.pl +++ b/docs/upgrades/upgrade_7.4.21-7.5.0.pl @@ -536,7 +536,7 @@ sub addPackage { $storage->addFileFromFilesystem( $file ); # 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 $package->update({ isPackage => 0 }); diff --git a/docs/upgrades/upgrade_7.5.0-7.5.1.pl b/docs/upgrades/upgrade_7.5.0-7.5.1.pl index 5eaafe102..3d07c8a5b 100644 --- a/docs/upgrades/upgrade_7.5.0-7.5.1.pl +++ b/docs/upgrades/upgrade_7.5.0-7.5.1.pl @@ -69,7 +69,7 @@ sub addPackage { $storage->addFileFromFilesystem( $file ); # 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 $package->update({ isPackage => 0 }); diff --git a/lib/WebGUI/AssetPackage.pm b/lib/WebGUI/AssetPackage.pm index edb78ccc2..7924d78c9 100644 --- a/lib/WebGUI/AssetPackage.pm +++ b/lib/WebGUI/AssetPackage.pm @@ -116,9 +116,13 @@ sub getPackageList { =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. @@ -187,7 +191,7 @@ sub importAssetCollateralData { #------------------------------------------------------------------- -=head2 importPackage ( storageLocation ) +=head2 importPackage ( storageLocation [, options] ) 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. +=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 sub importPackage { my $self = shift; my $storage = shift; + my $options = shift; my $decompressed = $storage->untar($storage->getFiles->[0]); my %assets = (); # All the assets we've imported my $package = undef; # The asset package @@ -232,7 +244,7 @@ sub importPackage { } # Handle autocommit workflows - if ($self->session->setting->get("autoRequestCommit")) { + if (!$options->{skipAutoCommit} && $self->session->setting->get("autoRequestCommit")) { if ($self->session->setting->get("skipCommitComments")) { WebGUI::VersionTag->getWorking($self->session)->requestCommit; }