I just got this notice, by editing an existing options component and updating this to use a custom options list callback. Notice was shown after save.

Notice: Undefined index: aslist in webform_select_options_ajax() (line 792 of sites\all\modules\webform\components\select.inc).

[void] webform_select_options_ajax('assessment')
#516 call_user_func_array('webform_select_options_ajax', Array)
#21 menu_execute_active_handler()

CommentFileSizeAuthor
#7 webform_empty_form_state.patch713 bytesquicksketch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Alan D.’s picture

And a second on page two, the final page, of a two step form that is using save draft functionality.

Notice: Undefined index: submitted in webform_client_form_pages() (line 2538 of sites\all\modules\webform\webform.module).

#1460 webform_client_form_pages(Array, Array)
#859 form_execute_handlers('submit', Array, Array)
#376 drupal_process_form('webform_client_form_46', Array, Array)
#131 drupal_build_form('webform_client_form_46', Array)
#1630 drupal_get_form('webform_client_form_46', stdClass (object), Array, )
[void] webform_node_view()
#850 call_user_func_array()
#1386 module_invoke_all()
#1284 node_build_content()
#2567 node_view()
#1406 node_view_multiple()
#2638 node_show()
[void] node_page_view()
#516 call_user_func_array()
#21 menu_execute_active_handler()

Totally not critical as everything runs as normal :)

Alan D.’s picture

Steps to replicate the second notice, ensure that there are no input components prior to the first page step in any multistep form, and step though the first empty page.

Coming across this as the first page in a few surveys were just introductory text.

Alan D.’s picture

Nearing deployment so I had to hack the webform.module :(

/**
 * Handle the processing of pages and conditional logic.
 */
function webform_client_form_pages($form, &$form_state) {
  $node = node_load($form_state['values']['details']['nid']);

+  // Multistep forms do not nessarily have any components on the first page.
+  if (!isset($form_state['values']['submitted'])) {
+    $form_state['values']['submitted'] = array();
+  }
quicksketch’s picture

Status: Active » Needs review

@Alan D, that's actually doesn't look like a bad hack. It's either that or making a "fake" element on the first page to populate $form_state['values']['submitted']. I've seen other users work around this problem by adding a hidden (or "Private") field on the first page, but it's obviously a work around. I think your solution looks pretty good by comparison.

I'm moving this to needs review, since it's a valid suggestion.

Alan D.’s picture

let me know if you want a patch - usually don't bother with trivial fixes like this :)

drupov’s picture

This should get commited...?

quicksketch’s picture

Status: Needs review » Fixed
FileSize
713 bytes

Thanks Alan, committed to 6.x-3.x, 7.x-3.x, and 7.x-4.x.

Status: Fixed » Closed (fixed)

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

markosaurus’s picture

Hi Alan D,

Just got the same thing running D7.19 and Webforms 7.x-3.18.

Created my own module to query some stuff a custom content type in the database and output it to webforms as a prepopulated list for use in a select list.

Got this in my Drupal log - Notice: Undefined index: aslist in webform_select_options_ajax() (line 792 of SITENAME\sites\all\modules\webform\components\select.inc).

Funnily enough it was working yesterday with only one content node, when I added another this morning, this happened and nothing is output.

Have you rolled that patch into the dev Alpha 6? If so I'll give that a go. Otherwise I'll have to try and dig deeper myself.

Thanks,

Mark