AJAX error with progress bars using Bible Module

Forums: 

This error was originally reported as an issue with Bible module on the Drupal.org web site by another user. I don't know if the original poster is still having the same problem, but I am getting the same error on my Church web site with the Bible module installed. I am running the latest version of Drupal 7 with version 7.x-1.4 of the Bible module.

Any time a progress bar is displayed (for example: when checking for module updates or running a bulk operation) , I initially see two progress bars at the top of the page. As the progress bars start to update, the first (probably erroneous) progress bar disappears and then I get the following error message:

An AJAX HTTP error occurred.
HTTP Result Code: 404 Debugging information follows. 
Path: NaN&op=update
StatusText: Not Found
ResponseText: Page not found | Church of the Master United Methodist (rest of error deleted for space).

If I scroll down past the error box, the second progress bar appears to be operating normally.

I have confirmed that this error is originating with the Bible module since when I disable that module in the admin pages, I do not get the error.

When I open that URL in my

When I open that URL in my browser, I get the following string:

KJVCUVCUVSNKJVSNCUVCUVSNASVWEBBBERV60YLTCPDVDARDMBDRCIDBGDBLZZLZZDCTSVVWBTLUTKRVAOVHNT

If I view the underlying page source in my browser, I can see the XML code.

This is using the Google Chrome browser.

Screen Capture

This screen capture shows the inital view of a page with a progress bar. Note the doubled progress bar on the screen:

File: 

Screen Capture 2

This screenshot shows the text of the error message:

File: 

Screen Capture 3

This shows the same update screen with progress bar. This time, the Bible module has been disabled:

File: 

Screen Capture 4

Final screen showing the progress bar working with no errors. Again, the Bible module was disabled for this test. I hope these screen shots help. Please let me know if you need further information.

File: 

An update and perhaps some insight into the problem

Looking at the original problem report filed on the drupal.org web site about this problem, I noted that the original poster called out an issue with the bible_webimport.js script that is included in your module (quoted below):

"So far I could track the error down to be produced by bible_webimport.js line 32:

<?php

progress.startMonitoring(url + para + "&op=update", 0);
?>

I replaced "&op=update" by "&op=update&calling_module=bible" which got reproduced in the error message. So I can't tell you, why or how this code is called so far."

Based on this, I tried importing a new bible to my sight via the web import tab. When running this function, I found that the progress bar worked normally: one progress bar displayed, no AJAX errors.

Further, I commented out the function containing the progress.startMonitoring call in the bible_webimport.js on my testing site and found that when running other Drupal features, the progress bar also worked normally.

Based on that, here is what I think is happening:

Somehow, your progress bar function in bible_webimport.js has gotten hooked into all progress bar invocations in the Drupal installation. When it is being called from your module, it receives the correct parameters and works as expected without error.

When other modules in Drupal call their progress bar routine, your progress bar function is called before the other modules progress bar routine. It generates the duplicate progress bar that I showed you in the screen shot and then, since your function in bible_webimport.js is being called without receiving the correct parameters from your module, it generates the AJAX error from the first progress bar. Meanwhile, the other progress bar continues to work normally.

I think the fix would either be to prevent your bible_webimport.js from hooking into all progress bars in the Drupal site. Or, you could wrap your code with some error checking to prevent your progress bar function from being started if it was not called from the Bible module or if there are invalid parameters.

Please note: I am not familiar enough to help with the programming side of getting this issue fixed, but I can help with testing.

Problem solved.

Dear Sir:

   Sorry for this late reply. I've solve this problem, and I'll put it in next version.

   Please modify bible_webimport.js, and add line after:

var url = Drupal.settings.bibleurl;

var para = Drupal.settings.biblepara;

var inimsg = Drupal.settings.bibleimsg;

var errmsg = Drupal.settings.bibleemsg;

if (!url) return;

   Add this line in red, to prevent null data entrance.
   Thanks for your report.

MikeLee

Thank you, it worked.

I was away for a week when you posted the fix to the bible_webimport.js script, but I just wanted to let you know that I finally implemented the fix on my site and I have confirmed that it has solved the problem.

Thank you for all of your efforts with this module and for your support.