Keep comments when packing asset content, since it will also remove conditional comments for IE. Fixes bug #11876

This commit is contained in:
Colin Kuskie 2010-09-20 13:37:12 -07:00
parent ab6ba36a34
commit 86ecb10198
5 changed files with 41 additions and 3 deletions

View file

@ -33,6 +33,7 @@ my $session = start(); # this line required
# upgrade functions go here
uniqueProductLocations($session);
removeBadSpanishFile($session);
repackTemplates( $session );
finish($session); # this line required
@ -76,6 +77,45 @@ sub removeBadSpanishFile {
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Repack all templates since the packed columns may have been wiped out due to the bug.
sub repackTemplates {
my $session = shift;
print "\n\t\tRepacking all templates, this may take a while..." unless $quiet;
my $sth = $session->db->read( "SELECT assetId, revisionDate FROM template" );
while ( my ($assetId, $revisionDate) = $sth->array ) {
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId, $revisionDate );
next unless $asset;
$asset->update({
template => $asset->get('template'),
});
}
print "\n\t\tRepacking head tags in all assets, this may take a while..." unless $quiet;
$sth = $session->db->read( "SELECT assetId, revisionDate FROM assetData where usePackedHeadTags=1" );
while ( my ($assetId, $revisionDate) = $sth->array ) {
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId, $revisionDate );
next unless $asset;
$asset->update({
extraHeadTags => $asset->get('extraHeadTags'),
});
}
print "\n\t\tRepacking all snippets, this may take a while..." unless $quiet;
$sth = $session->db->read( "SELECT assetId, revisionDate FROM snippet" );
while ( my ($assetId, $revisionDate) = $sth->array ) {
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId, $revisionDate );
next unless $asset;
$asset->update({
snippet => $asset->get('snippet'),
});
}
print "\n\t... DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {