perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kathryn Andersen <kat_li...@katspace.homelinux.org>
Subject Embperl::Form::Validate bug
Date Wed, 11 Oct 2006 05:36:37 GMT
I've been trying out Embperl::Form::Validate, (Embperl version 2.2.0)
and I've found what appears to be a bug with error messages.

If one does not give a $pref argument, and one does not give -msg values
in the RULES array, then all you get for an error message is the id
value of the error message.  I looked around in the code, and it appears that
the build_message method completely ignores the default
'default_language' setting, it only takes the 'default_language' from
the $pref argument, which is passed in unchanged by the error_message
method.

Line 362 of Embperl/Form/Validate.pm

my $default_language = $pref -> {default_language};

should be

my $default_language = $pref -> {default_language} || $self->{default_language} ;

Otherwise, what happens is that it says to itself, "hey,
$default_language is undefined, so I can't give you an error message"
and the error message then falls back to the default, which is the
id of the error message.

Which is not what one would desire.

Another question related to this -- the documentation for
Embperl::Form::Validate says 

msg
    field specific messages, if any. Maybe a hash with multiple languages.

param
    array with parameters which should subsituted inside the message

But it doesn't say how one should form the message to take advantage of
this parameter substitution, not what the parameters refer to.

Kathryn Andersen
-- 
 _--_|\     | Kathryn Andersen	<http://www.katspace.com>
/      \    | 
\_.--.*/    | GenFicCrit mailing list <http://www.katspace.com/gen_fic_crit/>
      v     | 
------------| Melbourne -> Victoria -> Australia -> Southern Hemisphere
Maranatha!  |	-> Earth -> Sol -> Milky Way Galaxy -> Universe

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message