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.

CommentFileSizeAuthor
#1 webform_empty_column_error-2424489-1.patch748 bytesmarkie
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

markie’s picture

Status: Active » Needs review
FileSize
748 bytes

As promised

DanChadwick’s picture

Status: Needs review » Fixed

Good 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

  • DanChadwick committed e6d9b40 on 7.x-4.x
    Issue #2424489 by markie, DanChadwick: Fatal error: Fixed Unsupported...
  • DanChadwick committed 590146e on 8.x-4.x
    Issue #2424489 by markie, DanChadwick: Fatal error: Fixed Unsupported...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.