Olle,

In my play I don't see the scene coz it is Ajax.()
 Of course debug is on 3.

>>Dependencies! Required files, classes and such!
I have an index() method in my controller that has a findAll() which is functioning fine.
I tried also to run index() in delete() :
  function delete($id)
    {
       
        if ($this->Slideshow->del($id))
        {
             $this->action = '';
            $this->index();
            $this->action = '';
            $this->render('delete', 'ajax');
        }

    }

It produces a Fatal error: Call to a member function on a non-object in...

Why is findAll() accessible by one method and not the other ?
Why is the code functioning in Graham Bird's tutorial and not in mine  ?

Graham Bird's code :
	function delete($id)
	{
		// deletes task from database
		$this->Task->del($id);
		$this->set('data', $this->Task->findAll());
		$this->render('done', 'ajax');
        }

If there is any Ajax debugging tactics training camp, I'll be happy to take part !!
But as far as I understand it now :
$this->Model->findAll() is killing the rendering !! 
And I know neither why nor how to debug it in my Ajax context !
The only thing I know to do to debug at the moment is to test $data in my view:
<?php 
echo "data:<br>";
print_r($data);

if ($data == "") echo "data is empty";
if (!isset($data)) echo "data is not set";
?>
And nothing shows up, nada, niet.
If I replace the findAll() with 'blah', $data is set with 'blah'.
So I'm back and stuck to the the conclusion that findAll() is killing the rendering !!!

That's all I understand from the play coz with Ajax I only see it from the backstage...




 


olle wrote:
Dear olivvv,

(Seen you around here before, haven't I?) I seem to recall a play about
this... let's see:

----

(Debugging Tactics enter stage left. Artist stands at his screen.)

DT (reads mind of Artist before talking): Have you tried assigning that
findAll() to a local temp variable?

Artist: Yeah, I turned DEBUG up to 2. And... yeah, setting a local var,
that could be OK. I'll do that.

DT: Then you might be able to see if the set() or the findAll() bombs.

Artist: You mean...

DT (interrupts): Yes! Dependencies! Required files, classes and such!

(Choir enters stage from right. Choir begins singing the "Cake
Debugging Song" on page [n].)

---

That's all I can remember of that play.




  


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to