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:
Doug Bell 2008-02-07 22:43:05 +00:00
parent e5ca1aa00d
commit 439fbce173
5 changed files with 21 additions and 7 deletions

View file

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

View file

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

View file

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

View file

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

View file

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