]> git.decadent.org.uk Git - maypole.git/commitdiff
fix for http://rt.cpan.org/Ticket/Display.html?id=14566
authorAaron Trevena <aaron.trevena@gmail.com>
Tue, 11 Oct 2005 18:37:23 +0000 (18:37 +0000)
committerAaron Trevena <aaron.trevena@gmail.com>
Tue, 11 Oct 2005 18:37:23 +0000 (18:37 +0000)
git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@391 48953598-375a-da11-a14b-00016c27c3ee

lib/Maypole/Model/CDBI.pm

index d99eb500d35eafb5beaefe281fc546ad468e4932..c80a2902e0ad69cd74bb507a4abd56d43dfbb25a 100644 (file)
@@ -1,6 +1,10 @@
 package Maypole::Model::CDBI;
 use base qw(Maypole::Model::Base Class::DBI);
 use Class::DBI::AsForm;
+# use Maypole::Form::CDBI;
+use CGI::Untaint;
+# use Maypole::Form;
+
 use Class::DBI::FromCGI;
 use Class::DBI::Loader;
 use Class::DBI::AbstractSearch;
@@ -8,7 +12,7 @@ use Class::DBI::Plugin::RetrieveAll;
 use Class::DBI::Pager;
 
 use Lingua::EN::Inflect::Number qw(to_PL);
-use CGI::Untaint;
+
 use strict;
 
 =head1 NAME
@@ -87,7 +91,7 @@ sub related_class {
                   $self->meta_info( has_a    => $accessor ) ||
                   return;
 
-    my $mapping = $related->{args}->{mapping};
+    my $mapping = $related->{args}->{mapping} || [];
     if ( @$mapping ) {
         return $related->{foreign_class}->meta_info('has_a')->{ $$mapping[0] }
           ->{foreign_class};