diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 0d1634296..915f192f2 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -14,6 +14,9 @@ - fixed #10706: FriendManager Style/Layout template options - fixed #10707: i18n Account_FriendManager::manageUrl - fixed #9962: gallery thumbnail view: JS problem in IE7 + - fixed a bug where the textarea (based) form plugins would put multiple + identical style tags in head in some cases, which caused javascript errors + in IE. ( Martin Kamerbeek / Oqapi ) 7.7.16 - fixed #10590: Session::DateTime->secondsToInterval doesn't allow 7 weeks diff --git a/lib/WebGUI/Form/Textarea.pm b/lib/WebGUI/Form/Textarea.pm index ded05ad35..5b9b647ee 100644 --- a/lib/WebGUI/Form/Textarea.pm +++ b/lib/WebGUI/Form/Textarea.pm @@ -142,9 +142,7 @@ sub toHtml { my $value = $self->fixMacros($self->fixTags($self->fixSpecialCharacters(scalar $self->getOriginalValue))); my $width = $self->get('width') || 400; my $height = $self->get('height') || 150; - my ($style, $url) = $self->session->quick(qw(style url)); - my $styleAttribute = "width: ".$width."px; height: ".$height."px; ".$self->get("style"); - $style->setRawHeadTags(qq||); + my ($style, $url, $stow) = $self->session->quick(qw(style url stow)); my $out = '' @@ -160,14 +158,21 @@ sub toHtml { { type => 'text/javascript' }, ); - unless ( $self->session->stow->get( 'texareaHeadTagsLoaded' ) ) { + # Make sure we load the css for this plugin only once per id. + unless ( $stow->get( 'textareaStyleLoaded_' . $self->get('id') ) ) { + my $styleAttribute = "width: ".$width."px; height: ".$height."px; ".$self->get("style"); + $style->setRawHeadTags(qq||); + $stow->set( 'textareaStyleLoaded_' . $self->get('id'), 1 ); + } + # Make sure we add the max length js only once for all texatareas. + unless ( $stow->get( 'texareaHeadTagsLoaded' ) ) { $style->setRawHeadTags( q| | ); - $self->session->stow->set( 'texareaHeadTagsLoaded', 1 ) + $stow->set( 'texareaHeadTagsLoaded', 1 ); } if ($self->get("resizable")) {