Provide a way for Template to import old packages that have headBlock properties, with tests.

This commit is contained in:
Colin Kuskie 2008-12-10 18:29:18 +00:00
parent bb5ced3e0d
commit 09f7caab40
3 changed files with 42 additions and 4 deletions

View file

@ -19,6 +19,7 @@ use base 'WebGUI::Asset';
use WebGUI::International;
use WebGUI::Asset::Template::HTMLTemplate;
use WebGUI::Utility;
use Clone qw/clone/;
=head1 NAME
@ -401,6 +402,30 @@ sub processRaw {
}
#-------------------------------------------------------------------
=head2 update
Override update from Asset.pm to handle backwards compatibility with the old
packages that contain headBlocks.
This method is deprecated and will be removed in the future. Don't plan
on this being here.
=cut
sub update {
my $self = shift;
my $requestedProperties = shift;
my $properties = clone($requestedProperties);
if (exists $properties->{headBlock}) {
$properties->{extraHeadTags} .= $properties->{headBlock};
delete $properties->{headBlock};
}
$self->SUPER::update($properties);
}
#-------------------------------------------------------------------
sub www_edit {
my $self = shift;