I am at a loss. I submit a form via Ajax using
submitForm: function(element) {
$.post(
webroot + 'users/settings',
$('#AJAXform').serialize(),
function() {
var option = $('#AJAXform').find('select option:selected');
$j.current.v.updateField(element, option.text());
$j.current.v.removeForms();
}
);
}
Indeed everything works fine… that is, until I set the debug level to 0.
Then the Ajax request fails. But the strange thing is that via Firebug I can see that I get an error 404 with written
Not Found
Error:
The requested address ‘/users/profile’ was not found on this server.
The problem is that I’m NOT calling the page /users/profile but rather /users/settings (users/profile is the page on which the form is located). And this only happens with the debug level to 0. So I guess it’s something related to security.
One may think I’m being blackholed, but the problem is that the Security component is not currently activated; moreover the blackhole should send a blank page, and not an error 404 (even less for the wrong page).
EDIT: I solved it. It turned out it was a redirect in the response which was giving an error. When debug = 0, that error would not be shown and a 404 would appear instead. Firefox would then guess the 404 message (which was not actually sent)
I solved it with
if ($this->RequestHandler->isAjax()) {
$this->autoRender = false;
}
I solved it. It turned out it was a redirect in the response which was giving an error. When debug = 0, that error would not be shown and a 404 would appear instead. Firefox would then guess the 404 message (which was not actually sent)