I am writing a module where I need to grab the submission values of a webform

I am using the webform_submission_insert hook found here however when I print out the $submission array using this:

drupal_set_message('<pre>'.print_r($submission).'</pre>', 'warning');

All I get is this:


It appears to me this hook is not working correctly and is not populating the array. How can I get the submission values?

I am using Webform version 7.x-4.0-alpha6. The webform I created has about 10 different input fields.

  • I am also getting the same results when I downgrade to 7.x-3.18 and use webform conditional 7.x-1.0-beta1. – joshmmo Nov 15 '12 at 16:05
  • 1
    spare yourself ache and pain and install the devel module. use dpm(), kpr() etc. – tenken Nov 15 '12 at 16:51

I was printing the array out incorrectly. Using this code to print works:

drupal_set_message(''. print_r($submission, TRUE) .'');
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.