When downloading a specified number of the most recent webform submissions in Excel format, the resulting file does not contain records and the message "warning: Illegal offset type in webform_get_submissions() (line 711 of /Library/WebServer/Documents/drupal7/sites/all/modules/webform/includes/webform.submissions.inc)." is displayed.

The code at line 711 was added in 7.x-3.26
- return $submissions;
+ // Reorder submissions to reflect table header sorting.
+ $ordered_submissions = array();
+ foreach($sids as $sid) {
+ $ordered_submissions[$sid] = $submissions[$sid];
+ }
+ return $ordered_submissions;

On debug, I could see that $sids was an array of arrays, not an array of int, and that for this case it was being set from the filters input.

The following change seems to fix the problem in my situation, but I don't know the module well enough to be sure I'm not breaking something else.

diff -u webform.submissions.inc.ORIG webform.submissions.inc
--- webform.submissions.inc.ORIG 2016-12-05 17:35:17.000000000 -0500
+++ webform.submissions.inc 2016-12-05 17:36:13.000000000 -0500
@@ -611,7 +611,7 @@

// No need to find SIDs if it was given to us.
if (isset($filters['sid'])) {
- $sids = array($filters['sid']);
+ $sids = $filters['sid'];
}
// Build the list of SIDs that need to be retrieved.
else {

Comments

cyberlily created an issue. See original summary.

Liam Morland’s picture