I'm a bit confused. I'm trying to delete an object and Maypole is
apparently not returning. It's sitting hogging the CPU and eating
memory. I've added some print statements and it appears to be sitting in
a call to retrieve_all(), or objects() :
sub delete : Exported {
return shift->SUPER::delete(@_) if caller ne "Maypole::Model::Base";
my ( $self, $r ) = @_;
$_->SUPER::delete for @{ $r->objects || [] };
>>>> I see the print from here <<<<
$r->objects( [ $self->retrieve_all ] );
>>>> But not from here <<<<
$r->{template} = "list";
$self->list($r);
}
Now it's a big table, so I can well believe retrieve_all will take
'forever'. What confuses me is why is it doing the retrieve at all?
The last thing the action does is invoke the list action, and that will
go and retrieve all the objects itself:
sub list : Exported {
my ( $self, $r ) = @_;
my $order = $self->order($r);
$self = $self->do_pager($r);
if ($order) {
$r->objects( [ $self->retrieve_all_sorted_by($order) ] );
}
else {
$r->objects( [ $self->retrieve_all ] );
}
}
So why does delete do it? And if it does need to, why isn't it using the
pager?
I've commented out that line in delete() and now it all seems to work.
Cheers, Dave
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Maypole-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-devel