diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 689e801a9..05330dd94 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -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 diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index f5fe175f9..0865c74c7 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -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, diff --git a/t/Asset/Asset.t b/t/Asset/Asset.t index 4f3bf6e6f..62203e141 100644 --- a/t/Asset/Asset.t +++ b/t/Asset/Asset.t @@ -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{