From bd6da5dd49b9a50d49098f97278e4b440cb17bd9 Mon Sep 17 00:00:00 2001 From: Aaron Trevena Date: Sat, 9 Dec 2006 10:36:38 +0000 Subject: [PATCH] fixes to fixes to changes to fixes git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@554 48953598-375a-da11-a14b-00016c27c3ee --- Changes | 1 + lib/Maypole.pm | 7 ++++++- lib/Maypole/Model/CDBI/Base.pm | 15 +++++++++++++++ lib/Maypole/Model/CDBI/DFV.pm | 4 ---- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Changes b/Changes index dee2dbc..372769a 100644 --- a/Changes +++ b/Changes @@ -22,6 +22,7 @@ For information about current developments and future releases, see: fixed template path ordering so i.e. /tablename/list is used before /list when provided with a tablename fixed template path with array refs fix to template being reset from path in plain templates (i.e. where no model), may affect those relying on the bug ( bug 23722 ) + added search_columns method to base cdbi model class, provides display_columns unless over-ridden 2.11 Mon 31 July 2006 diff --git a/lib/Maypole.pm b/lib/Maypole.pm index 6b40b70..fdb1b86 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -582,7 +582,11 @@ sub handler_guts { } # less frequent path - perhaps output has been set to an error message - return OK if $self->output; + if ($self->output) { + $self->{content_type} ||= $self->__get_mime_type(); + $self->{document_encoding} ||= "utf-8"; + return OK; + } # normal path - no output has been generated yet my $processed_view_ok = $self->__call_process_view; @@ -636,6 +640,7 @@ sub __setup_plain_template my ($self) = @_; # It's just a plain template + $self->build_form_elements(0); $self->model_class(undef); unless ($self->template) { diff --git a/lib/Maypole/Model/CDBI/Base.pm b/lib/Maypole/Model/CDBI/Base.pm index 118062f..2434284 100644 --- a/lib/Maypole/Model/CDBI/Base.pm +++ b/lib/Maypole/Model/CDBI/Base.pm @@ -321,6 +321,21 @@ sub related_class { } } +=head2 search_columns + + $class->search_columns; + +Returns a list of columns suitable for searching - used in factory templates, over-ridden in +classes. Provides same list as display_columns unless over-ridden. + +=cut + +sub search_columns { + my $class = shift; + return $class->display_columns; +} + + =head2 related_meta $class->related_meta($col); diff --git a/lib/Maypole/Model/CDBI/DFV.pm b/lib/Maypole/Model/CDBI/DFV.pm index ded183f..7848759 100644 --- a/lib/Maypole/Model/CDBI/DFV.pm +++ b/lib/Maypole/Model/CDBI/DFV.pm @@ -152,10 +152,6 @@ sub do_edit : Exported { if (ref $errors) { # pass errors to template $r->template_args->{errors} = $errors; - foreach my $error (keys %$errors) { - $r->template_args->{errors}{ucfirst($error)} = $errors->{$error} - } - # Set it up as it was: $r->template_args->{cgi_params} = $r->params; $r->template("edit"); -- 2.39.5