Posted by Christefano on June 23, 2007 at 6:13am
| Project: | Todolist |
| Version: | 6.x-1.0-beta1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
In both Safari 2 and Firefox 2 I get a 404 error for /todolist/create_task. When I manually go to that URL I get a blank screen even with display_errors = On in my php.ini.
Any ideas? I'd love to get this going. This is on a stock Drupal 5.1 installation with no other contrib modules enabled (except JQuery Update and Interface, of course).
Comments
#1
I just set up a new Drupal 5.1 installation w/ todolist, jquery_update, jquery_interface installed--and it is working for me with Firefox 2.0 and Windows XP. Could the problem you are experiencing could be a configuration or browser issue?
Suggestions:
The blank screen is by design, if you have not provided all the parameters the /todolist/create_task callback is looking for. Try this, instead:
/todolist/create_task?nid=1&order=1&task=oneYou should get a response similar to the following:
TodoList.add_incomplete_list();$('.todolist.incomplete').append('<li class="task" id="task-5"><input type="checkbox" name="task-5" /></li>');
$('#task-5').each(TodoList.add_nub);
$('#task-5').each(TodoList.bind_task);
$('#task-5').Highlight(1000, '#ff0');
$('.todolist.incomplete').SortableAddItem($('#task-5').get(0));
And this would indicate that the module is working correctly under normal circumstances.
Questions:
The strange part about your experience is that you get 404 when you click on "Add this task" but not when you visit the URL directly in your browser--the blank screen means HTTP Status code 200 OK and no further data (which is the correct response to the wrong parameters)
#2
Hi.
First to say: very nice little module.
The error is located in todolist.js. All urls begin with a slash! This did not work on most installations (for example on sub-dirs or on IIS).
I've created a patch that fixes this by replacing the slash with
index.php?q=.hth,
Stefan
#3
@Stefan: Thanks for the patch! I tested it and it works. There is only one thing I wish we could do to improve it. Currently, with your patch, the XMLHTTPRequest object will try to POST to different paths depending on where you are, like:
http://domain.tld/node/index.php?q=todolist/create_taskhttp://domain.tld/taxonomy/term/index.php?q=todolist/create_task
...and that works, but the path is not exactly where the file should be found. Technically, if there were a directory that existed in that location, it would fail because mod_rewrite wouldn't redirect to /index.php when the file appears to exist. Ideally, you would always have something like this:
http://domain.tld/index.php?q=todolist/create_taskExcept in cases where your Drupal installation resides in a sub-directory. That does indeed throw in a monkey wrench unless we can utilize a Drupal function like url()...
I have tried renaming the .js file to .js.php and bootstrapping drupal when the file is called directly, but then Drupal thinks the base_path() is the module directory, and generates url() incorrectly. So, for now, I'll commit this patch to HEAD because it does work, but hopefully down the road we'll find a way to accomplish the ideal solution I described above.
Patch committed to HEAD. Thanks for your contribution! :)
@christefano: Does this solve your problem?
#4
The above patch breaks Todolist for me when the site is in the web root. I get 404 and too many recursion errors.
I'm not sure what you mean about HEAD. The only release I see is 5.x-dev.
Regarding my earlier post, I was getting the 404 error with Todolist when my test site was in a subdirectory. Todolist works wonderfully when I test on a site installed in the web root. Cool!
#5
#6
Well, here's another try.
You don't need to get the base url via drupal, you can do it all with jQuery :-)
Tested with and without sub-dirs and it works fine.
The patch applies to 5.x-1.x-dev.
greetings,
Stefan
#7
Thanks for the patch. I just got to testing it.
patching file /www/drupal/sites/all/modules/todolist/todolist.jsHunk #1 FAILED at 23.
Hunk #2 FAILED at 64.
Hunk #3 FAILED at 77.
Hunk #4 FAILED at 90.
Hunk #5 FAILED at 104.
Hunk #6 FAILED at 114.
6 out of 7 hunks FAILED -- saving rejects to file /www/drupal/sites/all/modules/todolist/todolist.js.rej
#8
Works for me! Committed to CVS.
#9
Automatically closed -- issue fixed for two weeks with no activity.
#10
Still getting this error.
#11
I'm getting a white screen too.
found this code, but seems there is some other problem.
#12
5.x in no more maintained, so, like on 6.x it's solved I'm closing this
#13
Automatically closed -- issue fixed for 2 weeks with no activity.