Not so much a bug report, more of a FYI :-)
This nearly broke my heart, and made me realise that firebug is a tool I need to learn how to use better.
Basically, when Devel module is enabled, it appends [at least sometimes] some extra information to a page, time taken for queries etc.
The problem is that it also appends this information to the js response that filefield sends to the page.
Obviously this isn't what fielfield expects, and therefore it just 'hangs', displaying progress bar gif.
Simply disabling devel sorts this out pretty quickly.
It didn't happen all the time, but it did happen sometimes.
So... Well I don't know what happens next:-)
Document the issue?
Blame it on Devel?
Try to sort it out?
Regards
Alan
Comments
Comment #1
gnucifer commentedI too discoverd this problem some time ago. It took me some frustrating hours figuring that out that devel was the cause, but had up until now no idea why they could not live happily together. . :)
Comment #2
jpetso commented> Document the issue?
> Blame it on Devel?
> Try to sort it out?
Well, there is nothing that filefield can do as long as Devel appends its JavaScript to each and every Drupal output that it encounters. This can only be solved by the Devel module itself. As for documenting the issue, I added a note to the project page, linking to this issue. That should hopefully educate the interested user about this conflict. (Thanks for posting the explanation here.)
That's about everything we can do, I believe, so let's close this issue as fixed.
Comment #3
alanburke commentedHi jpetso,
I'll just move this to the Devel issue queue, to see whether they can shed any light.
I agree, it looks like something that you can't do anything about on the filefield side.
Regards
Alan
Comment #4
moshe weitzman commentedIf filefield is returning javascript, it should say so by adding Content type: text/javascript to the http headers. If you are returning HTML, then you can just call $GLOBALS['devel_shutdown'] = FALSE and devel will stay silent.
Comment #5
jpetso commentedFrom upload_js() of the Drupal 6 upload.module - filefield essentially has a plain copy of that code (but not yet with this nice comment):
where drupal_json() is what you propose: setting the Content-Type header and printing the JavaScript. I tried it, doesn't work in Konqueror (wants to save the JavaScript) and doesn't work in Firefox (spits out an error message). So, good suggestion, but unfortunately not possible for us to implement.
Comment #6
jpetso commentedThe $GLOBALS['devel_shutdown'] thing helps, though, I'll commit that one. Thanks for the suggestions, Moshe!
Comment #7
jpetso commentedShwoobeedoo, the silencing code is in CVS. I think I like it this way :)
Thanks to everyone involved, at last I can debug filefield *and* run Devel at the same time! (And so can you.)
Coming soon to a release tarball near you.
Comment #8
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #9
jpetso commentedI'm leaving this issue closed, nevertheless the fix has been reverted. Which means that Devel will still break filefield in the future. Sorry!
dopry doesn't like filefield to use a module-specific workaround and is not going to apply it to imagefield, so let's be consistent and leave it out in filefield as well (before dopry reverts it by himself). Although the fix is small and trivial, I can also see that his reasoning is sound - any other file upload module would have the same problem (including core's upload.module, which is unlikely to get an exception for Devel) so a generically-working fix still needs to go into Devel.
It's unfortunate that browsers don't handle JavaScript/JSON mimetypes good enough, or maybe we were just doing it wrong. Anyways, we need a better fix. For any follow-ups, please go to issue #253199: Make upload.js AJAX uploads work with Devel enabled.