Permalink
Browse files

submitted じゃないと error message をとれないのはおかしいので修正。後方互換がなくなるので plain のみ変更

  • Loading branch information...
1 parent 4f491b9 commit 7a1e3344947d347d74ce98292eb6ba29d1893861 @typester committed Sep 9, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/Ark/Form.pm
View
5 lib/Ark/Form.pm
@@ -261,7 +261,7 @@ sub localize {
sub error_message_plain {
my ($self, $name) = @_;
- return unless $self->submitted && $self->is_error($name);
+ return unless $self->is_error($name);
my ($error) =
grep { $_->[0] eq $name } @{ $self->_shakan->_fvl->{_error_ary} || [] }
@@ -272,7 +272,7 @@ sub error_message_plain {
sub error_messages_plain {
my ($self, $name) = @_;
- return unless $self->submitted && $self->is_error($name);
+ return unless $self->is_error($name);
my (@errors) =
grep { $_->[0] eq $name } @{ $self->_shakan->_fvl->{_error_ary} || [] }
@@ -319,6 +319,7 @@ sub _create_error_message {
sub error_message {
my ($self, $name) = @_;
+ return unless $self->submitted;
sprintf($self->message_format, $self->error_message_plain($name) || return);
}

0 comments on commit 7a1e334

Please sign in to comment.