diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index ba22de5f6..34e5c5ca9 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -4,6 +4,7 @@ - rfe: Asset->get should return a copy of the properties hashref - Fixed a typo in testEnvironment.pl version number for DBD::mysql - Fixed a Recurring Payments processing bug: illegal division by zero + - fix: How to hose your assets (perlDreamer Consulting, LLC) 7.3.8 diff --git a/lib/WebGUI/AssetPackage.pm b/lib/WebGUI/AssetPackage.pm index da1179aa5..54b686990 100644 --- a/lib/WebGUI/AssetPackage.pm +++ b/lib/WebGUI/AssetPackage.pm @@ -135,12 +135,21 @@ sub importAssetData { if (defined $asset) { # update an existing revision $error->info("Updating an existing revision of asset $id"); $asset->update($data->{properties}); - } else { + ##Pending assets are assigned a new version tag + if ($data->{properties}->{status} eq 'pending') { + $self->session->db->write( + 'update assetData set tagId=? where assetId=? and revisionDate='.$data->{properties}->{revisionDate}, + [WebGUI::VersionTag->getWorking($self->session)->getId, $data->{properties}->{assetId}] + ); + } + } + else { $asset = WebGUI::Asset->new($self->session, $id, $class); if (defined $asset) { # create a new revision of an existing asset $error->info("Creating a new revision of asset $id"); $asset = $asset->addRevision($data->{properties}, $version); - } else { # add an entirely new asset + } + else { # add an entirely new asset $error->info("Adding $id that didn't previously exist."); $asset = $self->addChild($data->{properties}, $id, $version); }