preprocess_node_webform is not working I wanted the error messages from the webform to be customised. So I wrote following piece of code in template.php of my theme. 

function sandesh_preprocess_node_webform(&amp;$vars, $hook) {
 if ($vars['node']-&gt;nid == "41" &amp;&amp; is_array($_SESSION['messages']['error']))   {
 $errors = &amp;$_SESSION['messages']['error'];
 $find = 'email';

 for($idx = 0; $idx &lt; count($errors); $idx++) {
  if (substr($errors[$idx], 0, strlen($find)) == $find) {
  $errors[$idx] = 'Please enter the email field';
  break;
   }
 }

}
}


But this is not working. Is there something wrong in the code? Or is there  any other method to get customized error message in the webforms ? Thank you
You don't need to code to do this. Have a look at the answers to this questions to find more information: How to modify user messages without hacking core user module?