From 650450caf089b65793c46ff38aa696337f4005df Mon Sep 17 00:00:00 2001 From: Aaron Trevena Date: Thu, 30 Nov 2006 16:46:12 +0000 Subject: [PATCH] fix to bug 23722 git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@553 48953598-375a-da11-a14b-00016c27c3ee --- Changes | 1 + lib/Maypole.pm | 14 +++++++------- lib/Maypole/Model/CDBI/AsForm.pm | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Changes b/Changes index 276835e..dee2dbc 100644 --- a/Changes +++ b/Changes @@ -21,6 +21,7 @@ For information about current developments and future releases, see: fix to path handling in mod_perl and CGI when location ends in / 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 ) 2.11 Mon 31 July 2006 diff --git a/lib/Maypole.pm b/lib/Maypole.pm index bc41335..6b40b70 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -638,13 +638,13 @@ sub __setup_plain_template # It's just a plain template $self->model_class(undef); - # FIXME: this is likely to be redundant and is definately causing problems. - - my $path = $self->path; - $path =~ s{/$}{}; # De-absolutify - $self->path($path); - - $self->template($self->path); + unless ($self->template) { + # FIXME: this is likely to be redundant and is definately causing problems. + my $path = $self->path; + $path =~ s{/$}{}; # De-absolutify + $self->path($path); + $self->template($self->path); + } } # The model has been processed or skipped (if is_applicable returned false), diff --git a/lib/Maypole/Model/CDBI/AsForm.pm b/lib/Maypole/Model/CDBI/AsForm.pm index 06f1039..cad330c 100644 --- a/lib/Maypole/Model/CDBI/AsForm.pm +++ b/lib/Maypole/Model/CDBI/AsForm.pm @@ -1179,7 +1179,7 @@ sub _options_from_objects { for my $object (@$items) { my $stringify = $args->{stringify}; if ($object->can('stringify_column') ) { - $stringify ||= $object->stringify_column if ($object->can($object->stringify_column)); + $stringify ||= $object->stringify_column if ($object->stringify_column && $object->can($object->stringify_column)); } my $id = $object->id; my $opt = HTML::Element->new("option", value => $id); -- 2.39.2