On showing a webform I get the following error:

Notice: Undefined index: grouping a webform_views_select_options_from_view() (line 90 of /var/www/sites/all/modules/webform_views_select/webform_views_select.module).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dtamajon created an issue. See original summary.

dtamajon’s picture

I propose to add a simple validation to avoid the error in the report panel.

harshita29’s picture

FileSize
402 bytes

Hi,
Here is the issue for the same.

dtamajon’s picture

Hi, your patch does not solve the error arisen in my case. Error is in line 87, because 'grouping' is not in the array, so I propose to include the 'grouping' check in the main 'if' to avoid doing it later in the else.

Maybe both patches should be merged as:

if (isset($flat) || !isset($view->style_options['grouping'])) {
Stevel’s picture

Does the error keep appearing after saving the style options again? Perhaps you updated from an older version of the module which didn't have the grouping option yet?

Stevel’s picture

Status: Active » Postponed (maintainer needs more info)
mikelutz’s picture

I see the same issue. What happens is that on a new view, if you never select a grouping field, then $view->style_option['grouping'] is never set. This causes the notice when attempting to access that field. If you add and remove a grouping, then $view->style_option['grouping'] is set to an empty array and there is no issue. The module needs to check to see if $view->style_option['grouping'] exists, because there is no guarantee that the array key is set if there is no grouping.

Stevel’s picture

Status: Postponed (maintainer needs more info) » Fixed

The isset($flat) would always return TRUE, since $flat is always set to either TRUE or FALSE.

I modified the condition to make it easier to understand what is going on here.

  • Stevel committed ef84bef on 7.x-1.x authored by dtamajon
    Issue #2873755 by dtamajon, Stevel, mlutz: Undefined index: grouping
    

Status: Fixed » Closed (fixed)

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