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.
I'm trying to download a CSV for a webform that has no submissions, but the download hangs forever and I get thousands of warnings in the watchdog log:
Warning: Division by zero in webform_results_batch_rows() (line 1140 of sites/all/modules/webform/includes/webform.report.inc).
The same happens when downloading only new submissions for a webform that has no new submissions.
Comment | File | Size | Author |
---|---|---|---|
#3 | webform-divide_by_zero_no_submissions-2003877-3.patch | 1.55 KB | DanChadwick |
Comments
Comment #1
Paul B CreditAttribution: Paul B commentedComment #2
quicksketchThanks for opening this issue.
Just curious, is there a reason why your wanted/needed to download a CSV for a webform with no submissions?
Comment #3
DanChadwick CreditAttribution: DanChadwick commentedHere's a patch. I searched the source for ' / ' and fixed another issue with degenerate webforms with no components, resulting in a divide by zero in calculating submission export batch size.
Note that while the divide by zero is fixed, no output file is created, which creates a little weirdness after the export completes. Firefox gives a file-not-found message. I didn't try other browsers.
Comment #4
Paul B CreditAttribution: Paul B commentedQuicksketch: no reason.
The patch in #3 seems to fix the divide-by-zero. I also get the file-not-found message.
Comment #5
DanChadwick CreditAttribution: DanChadwick commentedCommitted to 7.x-4.x.
Needs backport to 7.x-3.x and 6.x
Comment #6
fenstratNeeds porting to 8.x-4.x.
Comment #7
fenstratCommitted and pushed a01d3a9 to 8.x-4.x. Thanks!
Given @quicksketch's recent comments on back porting to the 3.x branches and 7.x-4.x reaching stability I don't think this needs back porting.