From 0c3f4a26df001f9c41d9a551f14887a6b071b320 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 15 Jan 2010 17:00:02 -0800 Subject: [PATCH] Fix a bug with extraHeadTags wrapper, prevent extraHeadTagsPacked and className from being initialized. --- lib/WebGUI/Asset.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index 1c6a09b58..dcfc67e32 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -160,6 +160,7 @@ property extraHeadTags => ( customDrawMethod=> 'drawExtraHeadTags', ); around extraHeadTags => sub { + my $orig = shift; my $self = shift; if (@_ > 1) { my $unpacked = $_[0]; @@ -172,11 +173,13 @@ around extraHeadTags => sub { } ); $self->extraHeadTagsPacked($packed); } + $self->$orig(@_); }; property extraHeadTagsPacked => ( fieldType => 'hidden', default => undef, noFormPost => 1, + init_args => undef, ); property usePackedHeadTags => ( tab => "meta", @@ -261,8 +264,13 @@ has [qw/parentId lineage ); has className => ( is => 'ro', - default => sub { ref shift; }, + builder => '_build_className', + init_arg => undef, ); +sub _build_className { + my $self = shift; + return ref $self; +} around BUILDARGS => sub { my $orig = shift;