In the case when someone doesn't properly set up a webform with components (columns) and tries to look at the table view of said form, one gets a nasty PHP fatality.
Fatal error: Unsupported operand types in /docroot/sites/all/modules/contrib/webform/views/webform.views.inc on line 519
This is due to a zero count of the $new_columns being passed into an array_fill position.
I have updated my codebase with the following which resolves the issue.
if (!count($new_columns)) {
drupal_set_message(t('There are no columns to display.'));
}
else {
$style_options['info'] += array_combine($new_columns, array_fill(1, count($new_columns), $style_prototype));
}
Patch to follow.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | webform_empty_column_error-2424489-1.patch | 748 bytes | markie |
Comments
Comment #1
markie commentedAs promised
Comment #2
danchadwick commentedGood one, although I don't think the message is needed. Thanks! Also removed some vestigial code.
Committed to 7.x-4.x and 8.x