Closed (fixed)
Project:
Webform
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Jun 2010 at 18:27 UTC
Updated:
4 Mar 2011 at 18:56 UTC
To be exact:
warning: array_keys() expects parameter 1 to be array, null given in /var/vhosts/vsu/sites/all/modules/webform/includes/webform.submissions.inc on line 270.
This happens due lack of validation session variable before using it. Here is simple patch to fix this:
--- webform.submissions.inc.old2 2010-05-25 13:52:31.000000000 -0500
+++ webform.submissions.inc 2010-06-03 13:23:27.000000000 -0500
@@ -266,7 +266,7 @@
$where[] = $column . ' = ' . (is_numeric($value) ? '%d' : "'%s'");
}
- if (isset($filters['uid']) && $filters['uid'] === 0) {
+ if (isset($filters['uid']) && $filters['uid'] === 0 && is_array($_SESSION['webform_submission'])) {
$anonymous_sids = array_keys($_SESSION['webform_submission']);
if (count($anonymous_sids)) {
$placeholders = array_fill(0, count($anonymous_sids), "%d");
| Comment | File | Size | Author |
|---|---|---|---|
| webform.submissions.inc_.2.patch | 586 bytes | pavel.karoukin |
Comments
Comment #1
quicksketchThanks, I used isset() instead of is_array() but the end effect should be the same. Committed to both 3.x branches.
Comment #3
alltooeasy commentedI am encoutering a very similar issue in Drupal 7. Can anyone suggest a fix?