Update attributes and macros test (#967)
This commit is contained in:
parent
335ea349db
commit
ac3ee4f6a2
|
@ -79,15 +79,13 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-
|
|||
'form' => 'text',
|
||||
'test' => sub {
|
||||
my ( $val, $conf ) = @_;
|
||||
if ( defined $conf->{'exportedVars'}{$val}
|
||||
or defined $conf->{'macros'}{$val}
|
||||
or $val eq '_timezone' )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
return 1, "__unknownAttrOrMacro__: $val";
|
||||
return 1
|
||||
if defined $conf->{'macros'}{$val} or $val eq '_timezone';
|
||||
foreach $_ ( keys %$conf ) {
|
||||
return 1
|
||||
if $_ =~ /exportedvars$/i and defined $conf->{$_}{$val};
|
||||
}
|
||||
return 1, "__unknownAttrOrMacro__: $val";
|
||||
}
|
||||
},
|
||||
'longtext' => {
|
||||
|
|
|
@ -72,15 +72,14 @@ sub types {
|
|||
form => 'text',
|
||||
test => sub {
|
||||
my ( $val, $conf ) = @_;
|
||||
if ( defined $conf->{exportedVars}->{$val}
|
||||
or defined $conf->{macros}->{$val}
|
||||
or $val eq '_timezone' )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
return ( 1, "__unknownAttrOrMacro__: $val" );
|
||||
return 1
|
||||
if ( defined $conf->{macros}->{$val} or $val eq '_timezone' );
|
||||
foreach ( keys %$conf ) {
|
||||
return 1
|
||||
if ( $_ =~ /exportedvars$/i
|
||||
and defined $conf->{$_}->{$val} );
|
||||
}
|
||||
return ( 1, "__unknownAttrOrMacro__: $val" );
|
||||
},
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user