Add noFormPost to packed content in the asset tables to prevent them
from overwriting the data that has been packed from the filter function. Rerun the upgrade script to repack all areas that use packing.
This commit is contained in:
parent
80dfb9ffd0
commit
6ac30bb2ea
5 changed files with 50 additions and 0 deletions
|
|
@ -13,6 +13,7 @@
|
|||
- fixed Two sets of delete buttons for photos in the Story.
|
||||
- fixed #9920: Survey: cannot add questions in IE
|
||||
- fixed #10449: Undefined template
|
||||
- fixed #10365: Head tags do not work "Use Packed Head Tags".
|
||||
|
||||
7.7.8
|
||||
- fixed: Basic Auth doesn't work if password contains colon (Arjan Widlak,
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ my $quiet; # this line required
|
|||
my $session = start(); # this line required
|
||||
|
||||
# upgrade functions go here
|
||||
repackTemplates( $session );
|
||||
|
||||
finish($session); # this line required
|
||||
|
||||
|
|
@ -44,6 +45,47 @@ finish($session); # this line required
|
|||
# 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 that use packing, this may take a while..." unless $quiet;
|
||||
my $sth = $session->db->read( "SELECT DISTINCT(assetId) FROM template where usePacked=1" );
|
||||
while ( my ($assetId) = $sth->array ) {
|
||||
my $asset = WebGUI::Asset::Template->new( $session, $assetId );
|
||||
next unless $asset;
|
||||
$asset->update({
|
||||
template => $asset->get('template'),
|
||||
usePacked => 0,
|
||||
});
|
||||
}
|
||||
|
||||
print "\n\t\tRepacking head tags in assets that use packing, this may take a while..." unless $quiet;
|
||||
$sth = $session->db->read( "SELECT assetId FROM asset where usePackedHeadTags=1" );
|
||||
while ( my ($assetId) = $sth->array ) {
|
||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId );
|
||||
next unless $asset;
|
||||
$asset->update({
|
||||
extraHeadTags => $asset->get('extraHeadTags'),
|
||||
usePackedHeadTags => 0,
|
||||
});
|
||||
}
|
||||
|
||||
print "\n\t\tRepacking snippets that use packing, this may take a while..." unless $quiet;
|
||||
$sth = $session->db->read( "SELECT DISTINCT(assetId) FROM snippet where usePacked=1" );
|
||||
while ( my ($assetId) = $sth->array ) {
|
||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId );
|
||||
next unless $asset;
|
||||
$asset->update({
|
||||
snippet => $asset->get('snippet'),
|
||||
usePacked => 0,
|
||||
});
|
||||
}
|
||||
|
||||
print "\n\t... DONE!\n" unless $quiet;
|
||||
}
|
||||
|
||||
|
||||
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -452,6 +452,7 @@ sub definition {
|
|||
extraHeadTagsPacked => {
|
||||
fieldType => 'hidden',
|
||||
defaultValue => undef,
|
||||
noFormPost => 1,
|
||||
},
|
||||
usePackedHeadTags => {
|
||||
tab => "meta",
|
||||
|
|
@ -1101,6 +1102,7 @@ Returns the extraHeadTags stored in the asset. Called in $self->session->style-
|
|||
|
||||
sub getExtraHeadTags {
|
||||
my $self = shift;
|
||||
$self->session->log->warn("usePackedHeadTags: ". $self->get('usePackedHeadTags'));
|
||||
return $self->get('usePackedHeadTags')
|
||||
? $self->get('extraHeadTagsPacked')
|
||||
: $self->get("extraHeadTags")
|
||||
|
|
@ -2027,6 +2029,7 @@ filter guidelines).
|
|||
|
||||
sub packExtraHeadTags {
|
||||
my ( $self, $unpacked ) = @_;
|
||||
$self->session->log->warn('packExtraHeadTags called with '. $unpacked);
|
||||
return $unpacked if !$unpacked;
|
||||
my $packed = $unpacked;
|
||||
HTML::Packer::minify( \$packed, {
|
||||
|
|
@ -2035,7 +2038,9 @@ sub packExtraHeadTags {
|
|||
do_javascript => "shrink",
|
||||
do_stylesheet => "minify",
|
||||
} );
|
||||
$self->session->log->warn('updated extraHeadTagsPacked to '. $packed);
|
||||
$self->update({ extraHeadTagsPacked => $packed });
|
||||
$self->session->log->warn('extraHeadTagsPacked is '. $self->get('extraHeadTagsPacked'));
|
||||
return $unpacked;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ sub definition {
|
|||
snippetPacked => {
|
||||
fieldType => "hidden",
|
||||
defaultValue => undef,
|
||||
noFormPost => 1,
|
||||
},
|
||||
usePacked => {
|
||||
tab => 'properties',
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ sub definition {
|
|||
templatePacked => {
|
||||
fieldType => 'hidden',
|
||||
defaultValue => undef,
|
||||
noFormPost => 1,
|
||||
},
|
||||
usePacked => {
|
||||
fieldType => 'yesNo',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue