fix 11954 Can't clear packed head tags

This commit is contained in:
Doug Bell 2010-11-16 18:47:51 -06:00
parent c8aa4a57da
commit 270f52aaaa
3 changed files with 31 additions and 2 deletions

View file

@ -7,6 +7,7 @@
- fixed #11956: ExtendCalenderRecurrence bug
- fixed #11965: FriendManager pagination and getUsersNotIn
- fixed #11964: files show in trash and in old revisions
- fixed #11954: Can't clear packed head tags
7.10.4
- Added WebGUI::Fork api

View file

@ -2308,7 +2308,11 @@ filter guidelines).
sub packExtraHeadTags {
my ( $self, $unpacked ) = @_;
return $unpacked if !$unpacked;
# If no more unpacked tags, remove the packed tags
if ( !$unpacked ) {
$self->update({ extraHeadTagsPacked => $unpacked });
return;
}
my $packed = $unpacked;
HTML::Packer::minify( \$packed, {
remove_newlines => 1,

View file

@ -172,7 +172,7 @@ sub definition {
package main;
plan tests => 132
plan tests => 134
+ scalar(@fixIdTests)
+ scalar(@fixTitleTests)
+ 2*scalar(@getTitleTests) #same tests used for getTitle and getMenuTitle
@ -1011,6 +1011,30 @@ $session->http->setRedirectLocation('');
is $clippedAsset->checkView(), 'chunked', 'checkView: returns "chunked" when admin is on for cut asset';
is $session->http->getRedirectLocation, $clippedAsset->getUrl('func=manageClipboard'), '... cut asset sets redirect to manageClipboard';
#----------------------------------------------------------------------------
# packed head tags
use HTML::Packer;
my $asset = WebGUI::Asset->getImportNode( $session )->addChild({
className => 'WebGUI::Asset::Snippet',
});
my $unpacked = qq{<title>
this is my title
</title>
};
my $packed = $unpacked;
HTML::Packer::minify( \$packed, {
remove_newlines => 1,
do_javascript => "shrink",
do_stylesheet => "minify",
} );
$asset->update({ extraHeadTags => $unpacked });
is $asset->get('extraHeadTagsPacked'), $packed, 'extraHeadTagsPacked';
$asset->update({ extraHeadTags => '' });
ok !$asset->get('extraHeadTagsPacked'), 'extraHeadTagsPacked cleared';
##Return an array of hashrefs. Each hashref describes a test
##for the fixId method.