Sunday, November 28, 2010

RequestHandler::isAjax() buggy?

I'm seeing some strange behavior on a site. I haven't been able to
reproduce it locally, just on the server, and it's also only showing
up just once in a while. What's happening is, occasionally, isAjax()
is incorrectly returning true, and so just the element is rendered.

public function index()
{
$this->Session->write('path_back', $this->here);

$this->set('data', $this->paginate());

if ($this->RequestHandler->isAjax())
{
$this->viewPath = 'elements'.DS.'books';
$this->render('pagination');
}
}

So, I've got a paginated list of books, and I'm loading further pages
using AJAX. The session business allows me to get back to the correct
index page from a "view" view. I can't think of any reason why that
would be involved, though.

I can't remember seeing anyone else report this sort of thing. Has
anyone run into it? Or have any suggestions for why this might be
occurring? Or how to go about debugging this?

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: