chx formapi tip.

Yesterday I was having fun with the image module creating a new hook to allow people to build contrib module which will modify images when they are uploaded. see for more details.

I needed to add in a hook to the node so that it would call my process after the validation had completed. and would always be called no matter what action was taken, Preview or submit.

I triied adding it before the #submit, but it would not call on a preview. After talking with chx, I found a cool feature, and a use for buttons besides firing scripts.

If you have 

$form['preview'] = array(
  '#type' => 'button',
  '#value' => t('Preview'),

When the user clicks on this button, it will submit as normal, but in the forms api, hook_validate() will be called but hook_submit() will not.

Cool for doing previews, but not submit.

Also the Image module now has views integration. Yay.

my projects: