[Catalyst-commits] r8703 - in
CatalystX-CRUD/CatalystX-CRUD-Controller-RHTMLO/trunk: .
lib/CatalystX/CRUD/Controller
karpet at dev.catalyst.perl.org
karpet at dev.catalyst.perl.org
Wed Dec 3 16:07:49 GMT 2008
Author: karpet
Date: 2008-12-03 16:07:49 +0000 (Wed, 03 Dec 2008)
New Revision: 8703
Modified:
CatalystX-CRUD/CatalystX-CRUD-Controller-RHTMLO/trunk/Changes
CatalystX-CRUD/CatalystX-CRUD-Controller-RHTMLO/trunk/lib/CatalystX/CRUD/Controller/RHTMLO.pm
Log:
release 0.19
Modified: CatalystX-CRUD/CatalystX-CRUD-Controller-RHTMLO/trunk/Changes
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD-Controller-RHTMLO/trunk/Changes 2008-12-03 15:14:08 UTC (rev 8702)
+++ CatalystX-CRUD/CatalystX-CRUD-Controller-RHTMLO/trunk/Changes 2008-12-03 16:07:49 UTC (rev 8703)
@@ -71,4 +71,7 @@
0.18 09 Oct 2008
* fix bug where form was not cleared during initial search
+
+0.19 03 Dec 2008
+ * fix bug where form error was not set correctly
Modified: CatalystX-CRUD/CatalystX-CRUD-Controller-RHTMLO/trunk/lib/CatalystX/CRUD/Controller/RHTMLO.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD-Controller-RHTMLO/trunk/lib/CatalystX/CRUD/Controller/RHTMLO.pm 2008-12-03 15:14:08 UTC (rev 8702)
+++ CatalystX-CRUD/CatalystX-CRUD-Controller-RHTMLO/trunk/lib/CatalystX/CRUD/Controller/RHTMLO.pm 2008-12-03 16:07:49 UTC (rev 8703)
@@ -4,7 +4,7 @@
use Carp;
use Class::C3;
-our $VERSION = '0.18';
+our $VERSION = '0.19';
=head1 NAME
@@ -77,7 +77,7 @@
for my $f ( $form->fields ) {
push( @err, $f->name . ': ' . $f->error ) if $f->error;
}
- return join( "\n", @err );
+ return join( "\n", grep {defined} @err );
}
=head2 form_to_object( I<context> )
@@ -115,9 +115,9 @@
# return if there was a problem with any param values
unless ( $form->validate() ) {
- $c->stash->{error} = $form->error; # NOT throw_error()
- $c->log->debug(
- "RHTMLO: form error:\n" . $self->all_form_errors($form) )
+ my $err = $self->all_form_errors($form);
+ $c->stash( error => $err ); # NOT throw_error()
+ $c->log->debug("RHTMLO: form error:\n$err\n")
if $c->debug;
$c->stash->{template} ||= $self->default_template; # MUST specify
return 0;
@@ -148,6 +148,7 @@
# if we have no input, just return for initial search
if ( !@arg && !$c->req->param && $c->action->name eq 'search' ) {
$c->log->debug("no input to search. return") if $c->debug;
+
# must clear explicitly since this is a new search
# and form may have been initialized elsewhere
$c->stash->{form}->clear;
More information about the Catalyst-commits
mailing list