Save and preview differences in hook_form_alter() I've created a module which uses hook_form_alter(). When a form is loaded (node/add) I hide a field, and the hook works fine. The problem appears when I do a preview of the form. When the form appears again I see the hidden field (the hook doesn't work). Why?

I hide the field through the line:

$form['field_versio']['und']['0']['value']['#type']="hidden";
First, you should use #access = FALSE which will disallow access to a element. #type hidden is not safe, it means that it is printed as a hidden input field which can be easily changed by the user, for example with Firebug.

When you do that, you can also directly set #access on the field element, like $form['field_versio']['#access'] and it will disallow access to all subelements (if there are multiple).

Not sure why it doesn't work in Preview, try adding a drupal_set_message('test') call to see if your hook is called.