Hi,

I found that $component_value never is set in webform.module (1928 line), because $form_state array hasn't key with component $cid. Correct me if I'm mistaken.

CommentFileSizeAuthor
webform-component-value.patch1.02 KBchalk

Comments

socialnicheguru’s picture

what effect does this have if any?

chalk’s picture

In next step $component_value is sent to _webform_client_form_add_component() function (1941 line). Sure, in _webform_client_form_add_component() we can again retrieve value from $form_state, but code doesn't seems good :)

And I use $component_value in one more patch, see also please #2153723: Form_state values in _webform_render_component implementations.

quicksketch’s picture

Status: Needs review » Closed (won't fix)

I found that $component_value never is set in webform.module (1928 line), because $form_state array hasn't key with component $cid. Correct me if I'm mistaken.

I think you are mistaken. In the submit handler for the form, the $form_state['values'] array is rekeyed here:

  // Flatten trees within the submission.
  $form_state['values']['submitted_tree'] = $form_state['values']['submitted'];
  $form_state['values']['submitted'] = _webform_client_form_submit_flatten($node, $form_state['values']['submitted']);

This could be a side effect of your other patch at #2153723: Form_state values in _webform_render_component implementations. As brought up in that issue, we're not likely to change the 3.x branch value handling precisely because of side-effects like this.

As mentioned in that issue, the best thing to do here to have the values handled more consistently is to upgrade to Webform 4.x. It made this an explicit API change: https://drupal.org/node/1609324#submission-structure