I have developed a drupal website for our internal site. In that, i have developed my custom module to search files in the server. Everything occurs by Ajax callback.

When the browser kept idle for 1 hour, An Ajax alert occurs as given below,

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /vll3c_latest/system/ajax
StatusText: OK
ResponseText: .....

I need to override the Ajax error and redirect to login screen. Please guide me to overcome this error.

Comments

rfay’s picture

Well, a 200 is not an error - that's a success. So I'd say you need to rethink your AJAX. Have you patterned it on the AJAX Example in the Examples project? That's the easiest way to get going.

reachurajay’s picture

Thanks for your quick reply. The response code shows the actual login screen content(html content of the login screen). How should i redirect it to that screen without showing the alert?

rfay’s picture

If you're getting the HTML content, that means that your ajax callback URL is not working. That could be because you need to rebuild the menu cache. It could be other reasons. But if you just hit /vll3c_latest/system/ajax with your browser, you'll see that it's not returning what you want.

Again, I recommend starting with the Ajax Example.

reachurajay’s picture

The "Introduction to AJAX-enabled Forms" created by you was much helps me... Thanks a lot. The AJAX callback(get_form_callback) function was not trigger if the browser kept idle for 1 hour. The code i have used for Ajax callback as given below,

 $form['actions']['submit1'] = array(
  '#type' => 'submit',
  '#value' => t('Submit'),
  '#executes_submit_callback' => FALSE,
  '#ajax' => array(
   'callback' => 'get_form_callback',
   'wrapper' => 'results_submit',
   'event' => 'click',
   'method' => 'replace',
   'keypress' => TRUE,
  ),
 );

I have tried with single return statement to that function. But still i am getting the same result.

rfay’s picture

Why don't you try the AJAX Example. Enable it on your site. See if you get the same problem. If you don't, then just re-implement using AJAX example as a starter.

I'm afraid I don't have much more to offer.

reachurajay’s picture

I just followed the "Ajax Example" given by you and restructure my Ajax form. Still the same problem exists. I think the URL expired because of Session timeout. If i refresh the page, it shows PNF error. Thanks for your offers.

reachurajay’s picture

Issue summary: View changes

Brakets removed

cilefen’s picture

Priority: Major » Normal
Issue summary: View changes

Support requests are never more than Normal priority.

Version: 7.12 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.