diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index f750caa7a..9dcf2bbfc 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -3,6 +3,7 @@ - Fixed a bug in the user manager where userId, date created, date updated, and karma were not showing up when editing users. - fix [ 1274239 ] Can Not Save Edits to Assets + - fix [ 1274414 ] extraHeadTags entirely unused (mwilson) 6.7.2 diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index c492d4a08..5e41226b2 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -661,6 +661,20 @@ sub getEditForm { } +#------------------------------------------------------------------- + +=head2 getExtraHeadTags ( ) + +Returns the extraHeadTags stored in the asset. Called in WebGUI::Style::generateAdditionalHeadTags if this asset is the $session{asset}. Also called in WebGUI::Layout::view for its child assets. Overriden in Shortcut.pm. + +=cut + +sub getExtraHeadTags { + my $self = shift; + return $self->get("extraHeadTags"); +} + + #------------------------------------------------------------------- =head2 getIcon ( [small] ) diff --git a/lib/WebGUI/Asset/Shortcut.pm b/lib/WebGUI/Asset/Shortcut.pm index 9e0d90919..915d7f1f3 100644 --- a/lib/WebGUI/Asset/Shortcut.pm +++ b/lib/WebGUI/Asset/Shortcut.pm @@ -189,6 +189,19 @@ sub getEditForm { } +#------------------------------------------------------------------- + +=head2 getExtraHeadTags ( ) + +Returns the extraHeadTags stored in the asset. Called in WebGUI::Style::generateAdditionalHeadTags if this asset is the $session{asset}. Also called in WebGUI::Layout::view for its child assets. Overriden here in Shortcut.pm. + +=cut + +sub getExtraHeadTags { + my $self = shift; + return $self->get("extraHeadTags")."\n".$self->getShortcut->get("extraHeadTags"); +} + #------------------------------------------------------------------- sub getShortcut { diff --git a/lib/WebGUI/Asset/Wobject/Layout.pm b/lib/WebGUI/Asset/Wobject/Layout.pm index 82befec11..3a8718795 100644 --- a/lib/WebGUI/Asset/Wobject/Layout.pm +++ b/lib/WebGUI/Asset/Wobject/Layout.pm @@ -155,6 +155,7 @@ sub view { foreach my $child (@{$children}) { if ($asset eq $child->getId) { unless (isIn($asset,@hidden) || !($child->canView)) { + WebGUI::Style::setRawHeadTags($child->getExtraHeadTags); if ($i > $numPositions) { push(@{$vars{"position1_loop"}},{ id=>$child->getId, diff --git a/lib/WebGUI/Style.pm b/lib/WebGUI/Style.pm index df8beb093..2de93d377 100644 --- a/lib/WebGUI/Style.pm +++ b/lib/WebGUI/Style.pm @@ -53,7 +53,7 @@ These subroutines are available from this package: =head2 generateAdditionalHeadTags ( ) -Creates tags that were set using setLink, setMeta, setScript, and setRawHeadTags. +Creates tags that were set using setLink, setMeta, setScript, extraHeadTags, and setRawHeadTags. =cut @@ -84,6 +84,9 @@ sub generateAdditionalHeadTags { } $tags .= ' />'."\n"; } + # append extraHeadTags + $tags .= $session{asset}->getExtraHeadTags."\n"; + delete $session{page}{head}; return $tags; }