From 0b671837d503a7369b002fdf15aa1bf7d25efcfa Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Thu, 26 Jun 2008 20:51:08 +0000 Subject: [PATCH] fix Locked shelf assets --- docs/upgrades/upgrade_7.5.13-7.5.14.pl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/upgrades/upgrade_7.5.13-7.5.14.pl b/docs/upgrades/upgrade_7.5.13-7.5.14.pl index 10f62b7e9..82779d87f 100644 --- a/docs/upgrades/upgrade_7.5.13-7.5.14.pl +++ b/docs/upgrades/upgrade_7.5.13-7.5.14.pl @@ -30,6 +30,7 @@ my $session = start(); # this line required # upgrade functions go here deleteBadReceiptEmailTemplate($session); +unlockShelfAssets($session); finish($session); # this line required @@ -43,6 +44,23 @@ finish($session); # this line required # print "DONE!\n" unless $quiet; #} +sub unlockShelfAssets { + my $session = shift; + print "\tUnlocking assets from improper Shelf package import..." unless $quiet; + for my $id (qw(4e-_rNs6mSWedZhQ_V5kJA 6tK47xsaIH-ELw0IBo0uRQ XNd7a_g_cTvJVYrVHcx2Mw _bZJ9LA_KNekZiFPaP2SeQ nFen0xjkZn8WkpM93C9ceQ)) { + my $asset = WebGUI::Asset->new($session, $id); + if ($asset && $asset->get('isLockedBy')) { + my $tagId = $asset->get('tagId'); + my $versionTag = WebGUI::VersionTag->new($session, $tagId); + if (! $versionTag->get('isLocked')) { + $asset->commit; + } + } + } + print "Done.\n" unless $quiet; +} + + sub deleteBadReceiptEmailTemplate { my $session = shift; print "\tDeleting bad Shop Email Receipt template... " unless $quiet;