Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When downloading results, I get the following in the watchdog table...
Notice: Undefined variable: row_count in webform_results_download()..(line 832 of webform\includes\webform.report.inc)
Notice: Undefined variable: options in webform_results_download() (line 832 of webform\includes\webform.report.inc)
Comment | File | Size | Author |
---|---|---|---|
#7 | webform_last_download-d6.diff | 1.15 KB | quicksketch |
#4 | webform-download_options_vars-1459130-3.patch | 1.2 KB | jeffschuler |
Comments
Comment #1
quicksketchThis looks like a side effect of #1292252: Update the exporting mechanism to make it extendable by other modules.
The end-result is not so bad. With this error, Webform fails to update the "last download time" for an individual user.
Thanks for the report, I'll look into fixing this.
Comment #2
wefreema CreditAttribution: wefreema commentedI had the same problem. +1
Comment #4
jeffschulerWhen I fixed things to get those vars from $export_info, downloading choked because $sid was also undefined... so I put 'last_sid' into $export_info, too.
Comment #5
davisbenThe patch fixes this error for me,
Comment #6
quicksketchThanks guys, much appreciated! I backported it to D6 with this patch, #4 committed as-is to 7.x-3.x. Thanks!
Comment #7
quicksketchHere's the D6 patch I meant to upload in #6.
Comment #8
byant CreditAttribution: byant commentedI have tried the patch for version 7.x-3.16 and 7.x-3.17, both not successful. And I have tried the development version too, but also not successful.
Can anyone help me?
FYI
but these statement did not appeared again:
Notice: Undefined variable: row_count in webform_results_download()..(line 832 of webform\includes\webform.report.inc)
Notice: Undefined variable: options in webform_results_download() (line 832 of webform\includes\webform.report.inc)
Thank you
Comment #9
jeffschulerThe fix is in 7.x-3.x-dev, so you should no longer need the patch.
If you did not see those errors, then the fix worked... So you might need to be more clear about what's not working for you.
I'm un-assigning you from the issue (as assigning yourself means you're taking responsibility for fixing it.)
Comment #10
byant CreditAttribution: byant commentedThanks for quick reply, Sorry for the "assign" I was wrong putting the info.
I know the patch including with the version 7.x-3.x-dev. I have installed this version (7.x-3.17+8-dev), but when I download the result always get 20 bytes with blank content. Have I get mistake installed and updating the database? I need guidance here, please.
Thank you
Comment #11
jeffschulerbyant: Is PHP throwing any errors?
Comment #12
quicksketchI'm marking this issue fixed again. Let's leave it fixed unless we have a conclusive report that the problem still exists (@byant's comment in #10 sounds like a completely different issue).
Comment #14
byant CreditAttribution: byant commentedyes, you are right, mine is php security problem (from my host provider) and it was fixed by changing this word:
readfile () to echo file_get_contents ()
Thanks for your effort and my provider (who gave solution)
Comment #15
Bitbull CreditAttribution: Bitbull commentedIn version 3.17 of the webform module, I'm still experiencing the problem (both lines in watchdog). And as we host the site on our own server, we suppose there's no php security problem ...
Could you please review, or (byant) tell me where to replace 'readfile' by 'file_get_contents' and what that change might result in?
Thanks in advance!
Comment #16
vernond CreditAttribution: vernond commentedTo change
readfile()
tofile_get_contents()
you will need to edit thewebform_results_download
function in the file webform/includes/webform.report.incWhen Webform builds the download it first writes it to a file on your server before streaming it down to your web browser. Some hosting configurations do not allow use of the PHP
readfile()
function for security reasons. There's no guarantee thatfile_get_contents()
will definitely work, but it should.Comment #17
jeffschulerBitbull: this was fixed on March 28th, which is after 7.x-3.17 was released. Upgrade to 3.18.
Comment #18
byant CreditAttribution: byant commentedThat's right:
"To change readfile() to file_get_contents() you will need to edit the webform_results_download function in the file webform/includes/webform.report.inc"
my comment for this state:
"There's no guarantee that file_get_contents() will definitely work, but it should."
in my case, it's work.
Sorry, I can not review this new version of webform yet. Thanks.