Override node title validation I have a pretty specific case where I want to fill in the node title myself if the user fills a checkbox above the title field.

For this reason, I can't use autonodetitle (because the title is only automatic if the checkbox is selected).

I have added my own validation callback using array_unshift() in a hook_form_alter to make sure its the first one but when its called the form already has an error (title field is required)

Is there any way I hook into the validation process earlier or even just remove the error for this field?

Thanks!
You can easily hook into the validation process by implementing hook_form_alter(&amp;$form, &amp;$form_state, $form_id) or it's cousin hook_form_FORM_ID_alter(). There you can inspect the $form variable, find out where the array of validation functions is, and perform array_unshift() on it.

You could also use the form alter hooks to modify the #required property of your title field, therefore preventing further validation errors down the line.

Don't forget that in order for your array_unshift() operation to be successful, the form needs to be passed by reference to your hook, or else you would only be modifying a local copy of the form variable. It's very easy to forget adding the ampersand &amp; in front of $form in the hook implementation. i.e. ...&amp; $form...