Fix for trying to make my webform_redirect module use hook_form_alter

  1. function webform_redirect_form_alter(&$form, &$form_state, $form_id) {
  2.         switch ($form_id) {
  3.         case 'webform_client_form_1':
  4.                 //$output .= dsm($form);
  5.                 //drupal_set_message("Form values:<pre>" . print_r($form['webform'], TRUE).'</pre>');
  6.                 $path = 'node/'.$form_values['submitted_tree']['refering_page']; // refering_page is a component which gets nid from URL
  7.                 $alias = drupal_lookup_path('alias',$path,$path_language); // handy api to look up alias path
  8.                
  9.                 $form_values['submitted_tree']['return_path'] = $alias; // here we add a new value to the array
  10.                 //print $node->webform['redirect_url'];
  11.                 $node->webform['redirect_url'] = 'http://graphiclabinc.com/'.$form_values['submitted_tree']['return_path'];
  12.         break;
  13.         }
  14. }

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.