I am implementing hook_webform_submission_insert($node,$submission) in order to send data to an external script for additional processing after it has gone through validation and been placed in to the Drupal database in the normal way by webform.
I have no problems passing the data to my external script using drupal_http_request() but I want to take an action depending on the HTTP value I get back from this script.
Specifically, if the script returns anything other than a 200 OK response I wan to chage the confirmation text that the form presents to the user.
I have tried setting
$node->webform['confirmation'] = 'error text here';
but the confirmation text that is displayed is still the text specified in the form
Is it possible to modify the confirmation text in this hook? If so can anyone suggest what I might be doing wrong?
thanks
Bill
Comments
Comment #1
quicksketchSo the $node variable is not passed by reference (AFAIK) in hook_webform_submission_insert() because module_invoke_all() does not pass values by reference, so its values can't be adjusted. Oddly it looks like if you use hook_webform_submission_presave(), it *will* modify the $node object (I haven't tested this).
Comment #2
billstennett commentedinteresting - I'll give it a try.
I did notice however that hook_webform_submission_presave seems to take the submission by reference (&$submission) but the node is still passed in as $node but I'll do a few tests.
cheers
Bill
Comment #3
quicksketchPostponing this one for now. Let me know if you have updates here. Generally I don't answer development questions in the issue queue.
Comment #4
quicksketchClosing after lack of activity. Please reopen if you have further (non-programming) questions here.