I have an element right.ctp with the code
echo "<div id='dropzone' class='rblock'>";
echo $this->element('pplcollection');
echo "</div>".$ajax->dropRemote('dropzone',null,array('url' => '/casts/
remuser/','with'=>'{draggedid:element.id}'', 'update'=>'res'));

The pplcollection.ctp element has the code below
echo $this->requestAction('casts/showcast'); // this should set
initial values
if (isset($users)){
        foreach ($users as $user){
                echo "<div 
id='imid".$user['UserProfile']['id']."'>".$html->image
('users/'.$user['Image']['filename'], array('alt' => '', 'width' =>
'30'))."</div>";
        }
}

my controller has the code called in the requestaction above as
function showcast(){
                $this->loadModel('UserProfile');
                $userlist = $this->UserProfile->getlist($this->Session->read
('productid'));
                $this->loadModel('Image');
                $users = $this->Image->getList($userlist);
                $this->set('users', $users);
                $this->render('/elements/pplcollection');
        }

The problem is that the 2nd query is causing recursion. The image
model the query is running on has a belongsTo relationship but has var
$recursive = -1; and has no other relationships.
Each time I try load this page I get timeouts from the cake core
although the 1st query is returning only 1 result so the 2nd query
equates to "    SELECT `Image`.`id`, `Image`.`filename`,
`Image`.`alttext`, `Image`.`user_profile_id` FROM `images` AS `Image`
WHERE user_profile_id = (8) ". I've run the queries in a regular view
and they run fine.
I'm using R1.25 stable.
Any help greatly appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to