I just installed Webform Matrix Component 7.x-4.16 for a multi-page webform project and immediately received notices and warning errors when visiting the page containing the matrix I had added on the webform. Here's what I have installed as well as steps to reproduce the errors:
INSTALLS
Drupal 7.39
Webform 7.x-4.10
Webform Matrix Component 7.x-4.16
STEPS TO CREATE MATRIX
1) Add a textbox field = Company Name (field = company_name)
2) Add a pagebreak
3) Add a matrix field with these properties:
Label = Units
Field Key = units
Matrix Rows = 2
Matrix Column = 5
element-1
- Title = Year
- Label Name 1 = Number of Units
- Label Name 2 = Average Occupancy
element-2
Field type = Textfield
Title = 2011
Mandatory = unchecked
Textfield and Maxlength = 50
element-3
Field type = Textfield
Title = 2012
Mandatory = unchecked
Textfield and Maxlength = 50
element-4
Field type = Textfield
Title = 2013
Mandatory = unchecked
Textfield and Maxlength = 50
element-5
Field type = Textfield
Title = 2014
Mandatory = unchecked
Textfield and Maxlength = 50
4) Add a pagebreak
5) Add a textbox field = Comments (field = comments)
6) Save the webform, click "View" tab and go through the Next buttons to the matrix to see these errors:
Notice: Undefined offset: 1 in webform_matrix_component_form_alter() (line 287 of \sites\all\modules\webform_matrix_component\webform_matrix_component.module).
•Notice: Undefined offset: 1 in webform_matrix_component_form_alter() (line 287 of \sites\all\modules\webform_matrix_component\webform_matrix_component.module).
•Notice: Undefined offset: 1 in webform_matrix_component_form_alter() (line 287 of \sites\all\modules\webform_matrix_component\webform_matrix_component.module).
•Notice: Undefined offset: 1 in webform_matrix_component_form_alter() (line 287 of \sites\all\modules\webform_matrix_component\webform_matrix_component.module).
Warning: Invalid argument supplied for foreach() in webform_matrix_component_form_alter() (line 281 of \sites\all\modules\webform_matrix_component\webform_matrix_component.module).
Comments
Comment #2
katannshaw commentedIn further testing I removed the pagebreaks from the form and the errors went away so this seems to be caused specifically with the combination of Webform matrix component fields + Webform pagebreak fields in my case. is anyone else experiencing this behavior?
Comment #3
fibie commentedI had this error as well with
Drupal 7.41
Webform 7.x-4.12
Webform Matrix Component 7.x-4.x-dev
I rolled it back to Webform 7.x-4.10 and it resolved the issue I think.
Something must have changed within the webform component?
Comment #4
chetan-singhal commentedcan someone verify
Comment #5
andjsmit commentedI ran into this issue today. After installing WMC (7.x-4.22) using Webform 7.x-4.12 and adding a matrix to an existing multi-page form, going to the page causes LOTS of the following message:
Comment #6
andjsmit commentedComment #7
andjsmit commentedQuick "fix" which doesn't appear to harm the form submissions starting at line 293 of webform_matrix_component.module :
Comment #8
chetan-singhal commentedtry to resave your form. I think you will not get error.
Comment #9
chetan-singhal commented