From 647d0b7f201d044b7c2dbcdbb9184f28e5fd4ab1 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 30 Sep 2010 17:17:26 +0200 Subject: [PATCH] Work around bu in template form plugin in wg < 7.9.8 --- lib/WebGUI/Mailing.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Mailing.pm b/lib/WebGUI/Mailing.pm index c4d615e..1b9d2df 100644 --- a/lib/WebGUI/Mailing.pm +++ b/lib/WebGUI/Mailing.pm @@ -442,9 +442,11 @@ sub www_edit { $properties->{ value } = $configuration->{ $name } if exists $properties->{ value }; my $formField = WebGUI::Form::DynamicField->new( $session, %{ $properties } ); + my $element = $formField->toHtml; # Works around a bug in WG::Form::Template in < 7.9.8 + my $readonly = $formField->getValueAsHtml; # where getValueAsHtml wouldn't set the correct options hashref my $html = $self->admin->canOverride - ? $formField->toHtml - : $formField->getValueAsHtml + ? $element + : $readonly ; $f->readOnly(