[Maypole] Error: Can't fetch data as class method ??

From: Peter Speltz (peterspeltz at yahoo.com)
Date: Wed Oct 27 2004 - 18:20:35 BST


Anyone know anything about this error? This code used to work fine. My enviro
is MP2,Maypole2.03,Apache2.049

I'm getting it when calling the My::Employee::has_a_new method from my
experimental Class::DBI::AsForm..
package My::Employee;
sub has_a_new {
    return { usr_id => [ qw/usr_nme pw/ ], prsn_id => [ qw/first_name mid_name
last_name dob/] };
}

the code in AsForm that calls it is this:
sub to_field {
    my ($self, $field, $how) = @_;
    my $class = ref $self || $self; # This could be significant ??
    if ($class->can("has_a_new") && $class->has_a_new->{$field}) { # <---HERE
        return $class->_to_foreign_inputs($field);
    }
 ...
}

Also, strangely the has_a_new method used to work fine calling from a template.

EX:

[% USE employee = Class("MY::Employee"); %]
[% SET foreign_cols = employee.has_a_new; %]
 DEBUG foreign_cols == [%foreign_cols # prints HASH(...) %]

weird and its driving me nuts.

thanks.

=====
pjs

                
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail

_______________________________________________
maypole mailing list
maypole at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:56 GMT