I am using an installation of Drupal 4.7.0 with Firefox 1.5.0.3 on Windows XP SP2. I have removed all extensions from Firefox, and I have enabled only a minimum of modules (story, help, page, upload) in the Drupal installation. I am using the bluemarine theme.
When attempting an Ajax-based upload, the following events occur:
0) On a new story node, enter test data in the title and body
1) Select a JPG image from my hard drive using the Browse button
2) Click the Attach button
3) A progress bar appears and quickly reaches 100% (the quickness is not necessarily a clue... it's a local web server and a 60k file, I'd expect it to be fast)
4) The progress bar is replaced with the attachment table, which shows the correct filename, and the correct file size in KB
5) Click the submit button to save the node
6) The node view page displays, but there are no attachments displayed (attachments are configured to be displayed by default)
7) Clicking edit again reveals the same form state as step 0 (obviously with the exception that the title and body content are filled in now)
If you replace step 2 above with clicking the submit button, the process works, but it uses traditional form upload methods.
In my attempts to debug, I have the following to contribute:
a) Line 679 of upload.module contains the Ajax response. There is no conditional to detect a failure in the process. 'status' = TRUE is hard-coded in the output.
b) It appears that the file is actually being uploaded, because the Ajax response contains the correct file size, the server-side code must have been aware of the file's contents.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | favicon_state_0.txt | 658 bytes | heine |
| #14 | favicon_state.txt | 658 bytes | heine |
| #8 | favicon_patch_0.txt | 644 bytes | pwolanin |
Comments
Comment #1
ADLongwell commentedThis isssue (34807) is potentially a duplicate, although it hasn't been touched for 5 weeks. I'd also note that when it occurs for me, I see no Javascript errors and no errors in my apache log.
Comment #2
ADLongwell commentedI have tested using FIrefox 1.0.8 on Ubuntu against the same Drupal instance. That browser works... it appears to not be a server-side error, but a client-side Javascript problem.
Comment #3
pwolanin commentedI had the same problem- due to the settings I put for the theme (though I think it's also a drupal bug):
http://drupal.org/node/64627
http://drupal.org/node/64650
To summarize: I unchecked the box for "use default shotcut icon" but did not supply another file instead. This resulted in a bad HTML header and the JS not loading in FF.
Comment #4
ADLongwell commentedI had also unchecked the use default shortcut icon setting. Re-selecting the checkbox fixes the problem. I suppose I'll create a patch to better handle this error condition. I agree: this is a Drupal bug.
Comment #5
gregglesGood detective work - just changing title back - be aware that titles in bugs are different than comment subjects in forum posts.
Comment #6
ADLongwell commentedgreggles: Thanks for the reminder.
I've discovered a patch that will work to fix this issue. However, I use Windows Eclipse and my own local SVN repository and I don't think I can generate a standardized .patch file. Here's the code change I propose:
In phptemplate.engine, change the if statement at line 147 from:
To:
Comment #7
pwolanin commentedChanging this to a "theme system" issue, and I'll mark my issue as duplicate.
Comment #8
pwolanin commentedAttached is a patch file based on the above. I changed is slightly so that there is only a single call to
check_url(theme_get_setting('favicon')).I tested this in Firefox 1.5, Drupal 4.7. Seems to completely solve the problem.
Comment #9
killes@www.drop.org commentedapplied to 4.7
Comment #10
dries commentedI think this patch works for HEAD too.
I guess favicons can be hosted on a different server, so we can do a file_exists().
I wonder, though, what happens when you specify a valid path to an non-existant favicon.
Could someone try that?
Comment #11
dries commentedWhy am I asking? Because check_url() doesn't check whether the URL is valid. I just prepares the URL for being emitted to the client.
I wonder how this patch could fix the problem.
Comment #12
killes@www.drop.org commentedpaths to non-existant favicons don't matter since the generated html is still valid. we might want to check if the file actually exists during form validation, though,
Comment #13
killes@www.drop.org commentedThe real bug is probably elsewhere, maybe in theme_get_setting. The original test should have failed when the select box was deselected. I will leave the patch in 4.7 for now, HEAD needs a better solution, which mght then be backported.
Comment #14
heine commentedAttached patch adds two else clauses to theme_get_setting leaving both logo and favicon in a consistent state.
Comment #15
heine commentedAnd now with normal path seperators (thanks killes)
Comment #16
pwolanin commented@killes: I agree that the path to the file should be validated when the theme form is submitted, but I think a check at this point is also a good idea since the file could get moved, renamed, deleted, or be inacccessible.
@dries: if I have a chance today I'll test whether the uploads fail in FF if one provides a non-null, but invalid, URL for the favicon.
Comment #17
pwolanin commentedFYI, with my patch above (and thus probably without) FF still uploads with a non-empty but invalid URL.
Below, the page header with the nonexistant file "foo" specified as the favicon:
Comment #18
heine commentedUpload doesn't fail when an invalid path is given. Only when the href attribute in LINK is empty, as killes wrote above. A check on form validation would be best, you'll see the 404 errors when you move the file and forget to update. Of course files usually do not move themselves.
Comment #19
heine commentedProper theme_settings validation is necessary (completely forgot about it).
Comment #20
Kjartan commentedFrom the comments it looks like this patch still needs some work.
Comment #21
heine commentedComment #22
coreb commentedMoving out of the "x.y.z" queue to a real queue.
Comment #23
pwolanin commentedLooks like this is still causing problems...
Comment #24
Ustas commentedYes, this problem is still actual: http://drupal.org/node/120798
Comment #25
ChrisKennedy commentedhttp://drupal.org/node/125656 marked as a duplicate.
Comment #26
Crell commentedIt's not just favicon, either. It looks like any image 404 at all will cause this problem. Marking this as dupe: http://drupal.org/node/125367
Comment #27
ceo3141 commentedI am having the same issue uploading the files; however, I have returned the theme to Blue Marine with the shortcut icon box checked, the favicon appears, but I still cannot upload files.
Here is my set up:
-Drupal 5.0
-commercial webhost with PHP 4.3.10
-enabled the content type (Event) for file upload [everything else about Events works fine]
-checked all the defaults in the File System and File Upload administration areas per the instructions for the Upload module in the handbook
-permissioned authenticated users to upload files under Access Control
When I try to upload files, either as the Administrator or as an Authenticated User, the moving bar shows up, looks like I have successfully uploaded, but then no files are attached. (No error message either.)
As I have tried implementing the solution in the forums (reinstituting the favicon), and it does not work, I am at a loss -- does anyone have any suggestions?
Many thanks.
Comment #28
Pushkar Gaikwad commentedI am having exact same problem, same bluemarine theeme, drupal 4.7. Let me try to apply the patch and see what happens
Comment #29
Pushkar Gaikwad commentedOk, I solved the problem by install the patch at #15 of url http://drupal.org/node/65153 . The patch is http://drupal.org/files/issues/favicon_state_0.txt
Now the problem is, I can not see my favicon at all. I tried all possible combo of admin->themse (I am using bluemarine) but it seems they have been disabled by this patch. I am looking to use bannter module for which I really need upload.module with images working but I also want favicon to work :)
Any solution ?
Comment #30
mtolmacs commentedI also having this issue with Drupal 5.1
Applying patches attached to this bug and see what happens.
Comment #31
Christefano-oldaccount commentedThe patch doesn't work for me. I decided instead to simply remove the "Attach" button (so the form looks more like the one in project_issue module) and added this to my style.css file:
This isn't a permanent solution, of course, but at least the ineffective "Attach" button is gone. The problems I can see are (1) screenreaders will still see the "Attach" button and (2) multiple uploads are only possible by saving and editing the node over and over again.
Comment #32
mtolmacs commentedI believe the original issue happens because the session in the asynchronous query checking overwrites the session array. I reported this bug to deal with it: http://drupal.org/node/152695
Anyway you can check if my assumption is right if you put some file log into the sess_open() and sess_close() function in includes/session.inc. It is enough to write out a SessionOpen and SessionClose row on the appropriate places. If the opens and closes nests, the here you go. Your session eventually gets overwritten randomly. If not, maybe the problem is elsewhere.
Comment #33
gracearoha commentedHas there been any solution to this? I am using FF 2.0, Drupal 5.2 and i cannot get the attach/upload to work with or without the icon checked. I also tried the style.css patch to remove the attach button but no go.
It was working fine when i was using FF 1.5 and Drupal 5.1.
Any ideas?
Comment #34
Christefano-oldaccount commentedPlease try the solution posted at http://drupal.org/node/162036#comment-277329 and let us know if it works for you.
Comment #35
gracearoha commentedi tried the solution posted by dtglmoon.
it doesn't seem to make a difference. I can upload the file, but the upload timer thingy keeps running and running.
if i watch the message in my browser footer i can see when the upload is really finished and then if i hit submit i see that the file has been attached. But how to get the upload timer thingy to stop running?
Comment #36
subspaceeddy commentedI can confirm a seemingly unrelated image 404 caused this problem for me, although oddly enough it worked OK if i was logged on as Administrator/user 1
*edit: this was supposed to be in reply to crell #26
Comment #37
dpearcefl commentedDue to the age of the last comment on this issue and due to the fact that D5 is no longer supported, I am closing this issue.