Reduced risk of XSS in factory templates (bug 16659)
model search/delete methods in model and subclassing the cdbi mode (bug 16661)
fixed problems with stringify_self and untaint missing ignore columns (bug 15678)
+ fixed Maypole::Model::CDBI::Plain to JustWork(TM) with plain CDBI Classes (bug 16977)
Documentation:
Fix to documentation for CGI::Maypole (bug 7263)
=cut
-__PACKAGE__->mk_classdata($_) for qw( config init_done view_object );
+__PACKAGE__->mk_classdata($_) for qw( config init_done view_object model_classes_loaded);
__PACKAGE__->mk_accessors(
qw( params query objects model_class template_args output path
__PACKAGE__->init_done(0);
+__PACKAGE__->model_classes_loaded(0);
+
=head1 HOOKABLE METHODS
As a framework, Maypole provides a number of B<hooks> - methods that are
# Load custom model code, if it exists - nb this must happen after the
# unshift, to allow code attributes to work, but before adopt(),
# in case adopt() calls overridden methods on $subclass
- $class->load_model_subclass($subclass);
+ $class->load_model_subclass($subclass) unless ($class->model_classes_loaded());
$config->model->adopt($subclass) if $config->model->can("adopt");
}
Maypole::Config->mk_accessors(qw(table_to_class));
+
+
sub setup_database {
my ( $self, $config, $namespace, $classes ) = @_;
$config->{classes} = $classes;
+ foreach my $class (@$classes) { $namespace->load_model_subclass(); }
+ $namespace->model_classes_loaded(1);
$config->{table_to_class} = { map { $_->table => $_ } @$classes };
$config->{tables} = [ keys %{ $config->{table_to_class} } ];
}
return $r->config->{table_to_class}->{$table};
}
+
+
+
1;
=head1 NAME