Provide a way for Template to import old packages that have headBlock properties, with tests.
This commit is contained in:
parent
bb5ced3e0d
commit
09f7caab40
3 changed files with 42 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue