This bug was discovered when using the import_html module. I am not 100% sure if its an import_html bug or a Drupal core bug. I report it here because I believe most likely the bug is in Drupal core.

When Clean URLs is enabled and a large number of files are on the import list using Batch mode there are no files imported. Instead an Error 404 not found message is displayed.

When Clean URLs is disabled clicking on the Batch button causes import_html to go to a URL like this:
http://www.example.info/index.php?q=batch&op=start&id=33
This URL works and the files are imported.

When Clean URLs is enabled it goes to a URL like this:
http://www.example.info/batch?op=start&id=34
As expected the "index.php?q=" part of the URL string is deleted. But because the "batch&op" part is changed to "batch?op" the URL is rewritten to be:
http://www.example.info/index.php?q=batch?op=start&id=34
which is not found.

Comments

dman’s picture

I've not seen this under import_html myself. The import_html batch process doesn't do anything abnormal to the path, and I don't think it would be triggering this.
When running over a large number of actions (800-1000 items being added to the queue at once ) it is possible to hit limits with batch API, but the error produced is not a 404.
I've always run import_html with clean URLs on, as it wouldn't work fully as desired without it.

If anything, it sounds like your Apache rewrite is a bit different from normal (or you are not using Apache). Have you changed the .htaccess at all?

spflanze’s picture

I am not using Apache. I am using Lighttpd which ignores .htaccess files.
I have posted my Lighttpd rewrite rules on this thread:
http://groups.drupal.org/node/114049
My latest version of it is posted near the end of it where the posting date is 2011-03-08 18:59.
I cannot see how this code could change an ampersand to a question mark anywhere. When I have time I will trace execution in Drupal to get to the bottom of this.

spflanze’s picture

Status: Active » Closed (works as designed)

I have had the same problem with Civicrm. As a result it became apparent to me that when Clean URLs is enabled it is normal and expected that question mark characters are changed to ampersands. I was mistaken to report this. This is a problem in how my Lighttpd configuration file takes into account clean URLs. I have made the appropriate changes there and it is working now.