From 7dc57ce29d41a942848247efc4c2bc78ea7acc68 Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Fri, 6 Aug 2010 16:59:19 -0500 Subject: [PATCH] allow both className (new) and class (backcompat) --- lib/WebGUI/Asset.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index c0e563a0a..34919087e 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -2638,6 +2638,7 @@ NOTE: Don't try to override or overload this method. It won't work. What you are sub www_editSave { my $self = shift; my $session = $self->session; + my ( $form ) = $session->quick(qw{ form }); ##If this is a new asset (www_add), the parent may be locked. We should still be able to add a new asset. my $isNewAsset = $session->form->process("assetId") eq "new" ? 1 : 0; @@ -2650,7 +2651,8 @@ sub www_editSave { } my $object; if ($isNewAsset) { - $object = $self->addChild({className=>$session->form->process("className","className")}); + my $className = $form->process('className','className') || $form->process('class','className'); + $object = $self->addChild({className=>$className}); return $self->www_view unless defined $object; $object->{_parent} = $self; $object->url(undef);