Skip to content

Commit 3ba6d43

Browse files
committedNov 4, 2011
Allow noFormPost to be dynamically generated with a sub. Not all property settings allow this!
1 parent a2a8218 commit 3ba6d43

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎lib/WebGUI/Asset.pm

+6-1
Original file line numberDiff line numberDiff line change
@@ -1276,9 +1276,13 @@ sub getFieldData {
12761276
my $attr = $self->meta->find_attribute_by_name( $property );
12771277
my $fieldType = $attr->fieldType;
12781278
my $fieldOverrides = $overrides->{ $property } || {};
1279+
my $noFormPost = $attr->noFormPost;
1280+
if (ref $noFormPost eq 'CODE') {
1281+
$noFormPost = $self->$noFormPost;
1282+
}
12791283
my $fieldHash = {
12801284
fieldType => $fieldType,
1281-
noFormPost => $attr->noFormPost,
1285+
noFormPost => $noFormPost,
12821286
tab => "properties",
12831287
%{ $self->getFormProperties( $property ) },
12841288
%{ $overrides },
@@ -1878,6 +1882,7 @@ exception.
18781882
sub loadModule {
18791883
my ($class, $className) = @_;
18801884
if ($className !~ /^WebGUI::Asset(?:::\w+)*$/ ) {
1885+
warn $className;
18811886
WebGUI::Error::InvalidParam->throw(param => $className, error => "Not a WebGUI::Asset class",);
18821887
}
18831888
(my $module = $className . '.pm') =~ s{::}{/}g;

0 commit comments

Comments
 (0)
Please sign in to comment.