Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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).
Comment | File | Size | Author |
---|---|---|---|
#3 | error_icon-2873755-3.patch | 402 bytes | harshita29 |
#2 | webform_validation-12060590.patch | 523 bytes | dtamajon |
Comments
Comment #2
dtamajon CreditAttribution: dtamajon commentedI propose to add a simple validation to avoid the error in the report panel.
Comment #3
harshita29 CreditAttribution: harshita29 commentedHi,
Here is the issue for the same.
Comment #4
dtamajon CreditAttribution: dtamajon commentedHi, 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:
Comment #5
Stevel CreditAttribution: Stevel commentedDoes 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?
Comment #6
Stevel CreditAttribution: Stevel commentedComment #7
mikelutzI 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.
Comment #8
Stevel CreditAttribution: Stevel commentedThe 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.