After submitting the create ipaper form, this text appears:
iPaper [my paper title] has been created"
Preparing document...
This can take a while, depending on the size of your upload.
It sits there for about 10 seconds and then the page turns entirely white. The URL remains example.com/ipaper_upload/10
If I navigate back to the homepage, I find that the paper actually does upload. However, no thumbnail is generated for it.
Instead, the link border for the thumbnail collapses into a blue vertical line next to the paper title and description.
I'm running iPaper 6.x-1.0-rc7. on D6-10.
Any help would be appreciated. Thank you.
Comments
Comment #1
grasmash commentedI did a bit of investigating to see just where things go wrong.
The screen turns white as soon as function ipaper_upload($node) is called. It still performs the function though. It sits at the white page with an hourglass as the while ($stat != "DONE") loop runs. Once finished, the page just stays on the white screen. Somehow the drupal_goto("node/$node->nid") redirect is not working.
The paper does upload though! I just have to manually direct the browser away from /ipaper_upload/$node->nid to see it. Why would this happen?
Comment #2
rares commentedDo you have anything in the logs about the process taking too long? About how much do you wait until you get the blank screen? Have you tried other documents or file formats?
Comment #3
grasmash commentedThank you for your response.
The upload screen is visible for about 3 seconds before it turns white. I have tried both .doc and .rtf formats. There are no messages in the PHP error log. The PHP max execution time is set to 45 seconds. I tried using:
drupal_set_html_head('<meta http-equiv="Refresh" content="0;URL='. $node->nid.'">');instead ofdrupal_goto("node/$node->nid");, but that has no effect either. It's almost as if the drupal framework crashes while the upload function continues to run.I've disabled every third party and non essential module and also increased the memory limit to 96mb, but the problem persists.
I've implemented a very primitive workaround for the moment:
By adding:
echo "Please wait while your file is uploading...";before the while loop,adding:
echo "...";to the loopand adding:
after the loop, I at least now have a message, indication of progress, and forced redirect.
However, I'd like to solve this problem correctly, as my solution does not look very professional.
I would appreciate any help that you could offer. Thank you!
Comment #4
rares commentedcan you enable logging from the module configuration page ('log all requests.."), try a new upload, and then post what the logs say?
I am interested how far the code gets. I assume there will be docs.upload, but then do you also have docs.changesettings, getconversionstatus, and getdownloadurl following immediately after? if you upload a larger file (>150kb) the conversion should take a while and you will get several getconversionstatus requests
Comment #5
grasmash commentedJust to let you know, I installed the new version and the problem persists.
There are a number of ipaper entries in the log, as well as a few php errors from the dblog.
I'm not sure if it's related, but the unserialize error is repeated a number of times, so, here are the details about that error:
Thanks for your help!
Comment #6
rares commentedI have just committed a patch that fixes the unserialize issue (log messages generated after you install the latest -dev version or make the changes below should not come with these errors, but older messages will still have the error).
If anyone else developing anything comes across this, see http://drupal.org/node/199337
In the case of this module, the changes had to do with the following section in ipaper_upload()
This should instead be:
More on the redirect issue later.
Comment #7
rares commentedI've read through the code again and I don't understand why it might be crashing.
I'd like to ask you:
- What browser are you using?
- If you use firefox, can you install the Live HTTP headers module and have it track what requests are happening beginning with /ipaper_transfer/node-id? That should be followed by /ipaper_upload/node-id and then the path to your new node. What happens instead? Can you paste the output from the addon window? Do this with the original code (no hack)
- Can you try replacing the very last line in ipaper_upload ( drupal_goto("node/$node->nid"); ) with return url("Test"); Does a page with a link to your new node appear now when you upload?
- I have had this problem before on various pages and I am inclined to say that it has to do peculiar text file encodings in your php/inc files. I use Windows and I sometimes put a funny character like â in a php file and it will lead to this strange behavior. I would recommend backing up your code and replacing all hacked files on your server with the originals. You should also disable modules that you have tested on your site previously. That might solve it.
Comment #8
grasmash commentedFirst of all, let me thank you for putting so much time into solving my particular issue. I really appreciate it.
I'm using FireFox 3.0.7 on OSX 10.5.6
I've applied the patch that you posted and also installed the Live HTTP headers addon to firefox. Here is the output when uploading an ipaper
Here also is the output in the event log. Notice that the PHP error is gone:
I actually haven't hacked any of the modules apart from yours, and that only in an attempt to workaround this issue. I've tried disabling all unnecessary modules but it has not had an effect.
I also tried switching the last line of the upload_ipaper() function and it does not display a link to the new upload's node. It seems that none of the drupal commands work once the screen has turned white.
I'll try disabling absolutely everything and even changing the theme, maybe that will solve it...
Comment #9
minesota commentedWhat is the memory limit in your php.ini ? If it is not 96mb raise it and see if the white screen still persists.
Comment #10
rares commentedmaybe return url("node/$node->nid"); will do the trick.
edit: I mean, maybe it will get the link to show so that we know the issue rests with drupal_goto
Comment #11
grasmash commentedComment #12
rares commentedfor the weird thumbnail the solution is to upgrade to rc8. or -dev
Comment #13
grasmash commentedreturn url("node/$node->nid"); does not display anything.
However, echo "node/$node->nid"; does print "node/11"; (correct nid);
So the nid is set. It's just that drupal commands (or displays for that matter) don't seem to be working.
Comment #14
grasmash commentedUpgraded to rc8. Thumbnails are working now. At least that's one problem down. You rock rares.
Comment #15
grasmash commentedHmm.. I downloaded the entire site into a local MAMP environment and it all seems to work fine, so it must have something to do with the server environment.
I'm trying to cook up a better work around than a simple echo of "Please wait." I noticed that $text is set to equal a nice themed progress bar earlier.
I'd like to just include "return $text" at the beginning of the ipaper_upload() function so that it reloads the framework display after deciding to blink to a white screen.
The problem with that, of course, is that returning a value ends the function prematurely. Is there a way to force the browser to return $text again without ending the function?
If so, then I can just follow up with a javascript redirect and have a pretty looking workaround.
Comment #16
rares commentedtry putting
$_REQUEST['destination'] = "node/$node->nid";instead of drupal_goto("node/$node->nid");Comment #17
grasmash commentedStill no luck. I've resorted to having the module build a somewhat nice looking "waiting for your document to be converted to ipaper" page upon page crash, and using a javascript redirect.
Comment #18
rsvelko commentedusually it is the memory limit of PHP that causes whitescreens... 96MB should be ok for a moderate site .. try if setting it to 128/256 MB solves the problem - at least we should know if this fixes it ... and then try to see what happens...
Comment #19
ma_no commentedJust for information, my screen turns blank white with importing csv file with node import module.
(PHP memory limit it's set to 96mb).
Comment #20
rares commentedCould you please test if you are still having the same probiem with iPaper 6.x-1.0?