Subject: | Using an array for field_name_space does not work as intended |
Date: | Mon, 05 Apr 2010 13:52:11 -0500 |
To: | bug-HTML-FormHandler [...] rt.cpan.org |
From: | Andy Clayton <clayton [...] physics.umn.edu> |
Hello,
It appears that field_name_space should be able to take an array (which
would be helpful), but since load_class throws an exception when it
can't find the class only the first one is ever tried. Please see the
attached patch.
Thank you,
Andy
Index: BuildFields.pm
===================================================================
--- BuildFields.pm (revision 1431)
+++ BuildFields.pm (revision 1432)
@@ -201,10 +201,11 @@
my $loaded;
foreach my $ns (@{$self->field_name_space}) {
$class = $ns . "::" . $type;
- if( Class::MOP::load_class($class) ) {
+ try {
+ Class::MOP::load_class($class);
$loaded++;
last;
- }
+ } catch { }
}
die "Could not load field class '$type' for field '$name'"
unless $loaded;