| 
      
      
      From: Victor P. <ope...@ha...> - 2001-12-11 10:50:16
      
     | 
| Hello,
I wrote a method in a handler that inherits from CommonHandler, all it does
is select a list of objects using fetch_group based on the user_id of the
current user. As far as I can tell it is written almost identical to any
other method, however, I get this error when I try to do fetch_group(),
Undefined subroutine &nasa::Handler::CreditCard::ARRAY called at (eval 446)
line 1.
Why would that happen?
It's probably obvious, but it's also 3am...
Thanks.
-Victor
P.S. Here's the offending code:
sub list_mine
{
	my($class,$p) = @_;
	my $R = OpenInteract::Request->instance;
	unless($R->{auth}{logged_in})
   	{
		return "<h1>Error</h1>Please log in...";
	}
	$p ||= {};
	my %params = %{$p};
	my $object_class = $class->MY_OBJECT_CLASS;
	my $uid = $R->{auth}{user}->id;
	my $my_cards = eval($object_class->fetch_group({where => "user_id =
$uid"}));
	if($@)
	{
		$R->scrib(0,"Failed to get a list of cards: $@, obj: $object_class");
		return "<h1>Error</h1>Could not fetch a list of cards...$@";
	}
	use Data::Dumper;
	$params{debug_message} = Dumper($R);
	$params{credit_cards} = $my_cards;
	return $R->template->handler({},\%params,{name =>
'reg_nasa::nasa_card_list'});
}
 |