kpr() in my form validation and submit function is not being called In my form validation and submit functions, kpr() is not being called. Is there a better way to check that I'm in those functions? If kpr() isn't ideal to output my $form_state array, then what is ideal?
Everything that is output with drupal_set_message() (the function that kpr() uses to output the message) could not be visible from the browser if code redirects the user to another page after drupal_set_message() is called and before the page is rendered. After a form is submitted, the users are redirected to a page whose URL is set in $form_state['redirect'] or $_GET['destination']; the latter takes the precedence over the former.
To avoid the users are redirected after the form is submitted, you can:


Set $form_state['rebuild'] to TRUE
Set $form_state['redirect'] to FALSE


Setting $form_state['no_redirect'] to TRUE would have the same effect, but form builder functions, form validation handlers, and form submission handlers should never set $form_state['no_redirect'].

A preferred method would be calling watchdog(). If you have the Database Logging module enable, then the message output from the module will be visible in admin/reports/dblog.

For debugging messages, you can call watchdog() passing WATCHDOG_DEBUG as value for the $severity parameter.

References


drupal_redirect_form()