Keep comments when packing asset content, since it will also remove conditional comments for IE. Fixes bug #11876
This commit is contained in:
parent
ab6ba36a34
commit
86ecb10198
5 changed files with 41 additions and 3 deletions
|
|
@ -13,6 +13,7 @@
|
||||||
- added findBrokenAssets.pl shows the classname of broken assets (William McKee, Knowmad Technologies)
|
- added findBrokenAssets.pl shows the classname of broken assets (William McKee, Knowmad Technologies)
|
||||||
- fixed #11866: Default ordering for Zip files is wrong
|
- fixed #11866: Default ordering for Zip files is wrong
|
||||||
- fixed: typo in the Gallery Add Archive default templateId.
|
- fixed: typo in the Gallery Add Archive default templateId.
|
||||||
|
- fixed #11876: packing templates, snippets, headtags removes conditional CSS comments
|
||||||
|
|
||||||
7.10.0
|
7.10.0
|
||||||
- fixed #11812: Checking www_ajaxSave's response in the cart js, urlencoding post parameters
|
- fixed #11812: Checking www_ajaxSave's response in the cart js, urlencoding post parameters
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ my $session = start(); # this line required
|
||||||
# upgrade functions go here
|
# upgrade functions go here
|
||||||
uniqueProductLocations($session);
|
uniqueProductLocations($session);
|
||||||
removeBadSpanishFile($session);
|
removeBadSpanishFile($session);
|
||||||
|
repackTemplates( $session );
|
||||||
|
|
||||||
finish($session); # this line required
|
finish($session); # this line required
|
||||||
|
|
||||||
|
|
@ -76,6 +77,45 @@ sub removeBadSpanishFile {
|
||||||
print "DONE!\n" unless $quiet;
|
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
|
# Describe what our function does
|
||||||
#sub exampleFunction {
|
#sub exampleFunction {
|
||||||
|
|
|
||||||
|
|
@ -2256,7 +2256,6 @@ sub packExtraHeadTags {
|
||||||
return $unpacked if !$unpacked;
|
return $unpacked if !$unpacked;
|
||||||
my $packed = $unpacked;
|
my $packed = $unpacked;
|
||||||
HTML::Packer::minify( \$packed, {
|
HTML::Packer::minify( \$packed, {
|
||||||
remove_comments => 1,
|
|
||||||
remove_newlines => 1,
|
remove_newlines => 1,
|
||||||
do_javascript => "shrink",
|
do_javascript => "shrink",
|
||||||
do_stylesheet => "minify",
|
do_stylesheet => "minify",
|
||||||
|
|
|
||||||
|
|
@ -242,7 +242,6 @@ sub packSnippet {
|
||||||
|
|
||||||
if ( $self->get('mimeType') eq "text/html" ) {
|
if ( $self->get('mimeType') eq "text/html" ) {
|
||||||
HTML::Packer::minify( \$packed, {
|
HTML::Packer::minify( \$packed, {
|
||||||
remove_comments => 1,
|
|
||||||
do_javascript => "shrink",
|
do_javascript => "shrink",
|
||||||
do_stylesheet => "minify",
|
do_stylesheet => "minify",
|
||||||
} );
|
} );
|
||||||
|
|
|
||||||
|
|
@ -525,7 +525,6 @@ sub packTemplate {
|
||||||
my ( $self, $template ) = @_;
|
my ( $self, $template ) = @_;
|
||||||
my $packed = $template;
|
my $packed = $template;
|
||||||
HTML::Packer::minify( \$packed, {
|
HTML::Packer::minify( \$packed, {
|
||||||
remove_comments => 1,
|
|
||||||
do_javascript => "shrink",
|
do_javascript => "shrink",
|
||||||
do_stylesheet => "minify",
|
do_stylesheet => "minify",
|
||||||
} );
|
} );
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue