Answers.Body: <p>While I suppose you could empty the <code>$params</code> array, it would be a bit clumsy.  Meanwhile you'll need a way to notify the user in context, so something form-specific would be helpful.</p>
  
  <p>Instead of using hook_civicrm_pre, you might consider using <a href="http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_validateForm" rel="nofollow">hook_civicrm_validateForm()</a>.  You'd be able to run the same checks, but in case the value is no good, you could send the user back to fix it.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-06T19:32:33.613Z
Answers.Text: I tried adding hook_civicrm_validateFom, but it never gets called. Is there something I must do to make sure it does get called?
Answers.UserDisplayName: Bob Jones
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-07T05:29:24.360Z
Answers.Text: Not sure where the problem is happening, but it should be getting called on any form you use.  Try setting an error on a field you know is there by doing something like `$errors['first_name'] = 'DEBUG TEST';`
Answers.UserDisplayName: Andie Hunt
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-04T20:04:07.827Z
Answers.LastActivityDate: 2015-12-04T20:04:07.827Z
Answers.UserDisplayName: Andie Hunt
Body: <p>User is adding a new email. Call to civicrm_pre detects a problem that requires that the update not happen. It hasn't actually happened by the time civicrm_post or post_save_civicrm_email is called. The update actually happens after post_save is called. </p>
  
  <p>How do I abort the update?</p>
  
Tags: <database>
Title: postsave stop database update
ThreadText: # postsave stop database update
  
  (Asked by: username_0 on 2015-12-04)
  
  User is adding a new email. Call to civicrm\_pre detects a problem that requires that the update not happen. It hasn't actually happened by the time civicrm\_post or post\_save\_civicrm\_email is called. The update actually happens after post\_save is called.
  
  How do I abort the update?
  
  **Tags:** database
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-12-04. Score: 2
  
  While I suppose you could empty the `$params` array, it would be a bit clumsy. Meanwhile you'll need a way to notify the user in context, so something form-specific would be helpful.
  
  Instead of using hook\_civicrm\_pre, you might consider using [hook\_civicrm\_validateForm()](http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_validateForm). You'd be able to run the same checks, but in case the value is no good, you could send the user back to fix it.
  
  > **Comments:**
  > **username_0**: I tried adding hook_civicrm_validateFom, but it never gets called. Is there something I must do to make sure it does get called?  
  > **username_1**: Not sure where the problem is happening, but it should be getting called on any form you use.  Try setting an error on a field you know is there by doing something like `$errors['first_name'] = 'DEBUG TEST';`  
  
  ---
  
  