Spinning off separate issue from https://drupal.org/node/2043735.

Fresh install of Surveyor. Created a multipage form with a simple same page conditional on second page hide/show markup dependent on Select options. Top of second page shows:
Notice: Undefined index: submitted in webform_client_form_validate() (line 2555 of .../sites/all/modules/contrib/webform/webform.module).

I am only seeing this notice on pages with same page conditionals.

Comments

quicksketch’s picture

Thanks @drubin for making a new issue. So if I understand this correctly, this situation only occurs if your first page contains *only* markup components? If you add a textfield to the first page the error goes away?

Also glad to see use of Surveyor. :)

quicksketch’s picture

Re-reading your request, I'm not sure that's what you were saying. What's on the first page of your form?

drubin’s picture

I started fresh and retested:
If I have a one page form with same-page conditionals -no notice.
If I add a pagebreak and put only markup on the firstpage I get the above notice on the second page.
If I add a textfield to the first page, the notice no longer shows up on the second page.
When I remove the textfield from the first page the notice returns on the second page.

quicksketch’s picture

Okay, great! So this seems like an easy problem to solve. The $form_state['values']['submitted'] array is probably empty just because there isn't any data that's actually submitted by the first page (markup components don't submit any data). Sounds like we're just missing a simple IF statement.

quicksketch’s picture

Title: Notice: Undefined index when conditionals are set » Notice: Undefined index when conditionals are set and first page contains only markup fields
Status: Active » Fixed
StatusFileSize
new710 bytes

This patch should solve the problem. Considering it's so trivial, I've committed it to the project directly. This seems to only affect the 4.x branch of the module, so no need for a backport. Thanks again for the report!

quicksketch’s picture

Priority: Normal » Minor

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Added code tag