Answers.Body: <p>The forms themselves aren't drupal forms so drupal hooks won't do anything, but you <em>can</em> put civi hook implementations in a drupal module, if you prefer using drupal modules over civi extensions.</p>
  <p>Note there is a caching/bootstrap bug where the civi hooks won't get called from a drupal module if running via command line, but they work in the UI.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-28T16:28:24.273Z
Answers.LastActivityDate: 2023-05-28T16:28:24.273Z
Answers.UserDisplayName: Demerit
Body: <p>My website is built on Drupal, and I prefer using Drupal hooks over CiviCRM hooks for modifying and validating forms, as I find Drupal modules easier to create and their hooks more user-friendly. However, when I follow the standard Drupal alter process, such as employing hook_form_alter and using krumo($form_id) to print out and identify the form's ID, I am unable to obtain any output for CiviCRM forms.</p>
  <p>Is it possible to use Drupal hooks instead of CiviCRM hooks for this purpose?
  I would greatly appreciate any assistance that anyone can provide. Thank you very much.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-05-29T20:20:57.913Z
Comments.Text: what sort of 'civicrm forms' are you dealing with?
Comments.UserDisplayName: petednz - fuzion
Tags: <drupal><hooks>
Title: How can I utilize Drupal hooks for altering and validating forms in place of CiviCRM hooks?
ThreadText: # How can I utilize Drupal hooks for altering and validating forms in place of CiviCRM hooks?
  
  (Asked by: username_0 on 2023-05-28)
  
  My website is built on Drupal, and I prefer using Drupal hooks over CiviCRM hooks for modifying and validating forms, as I find Drupal modules easier to create and their hooks more user-friendly. However, when I follow the standard Drupal alter process, such as employing hook\_form\_alter and using krumo($form\_id) to print out and identify the form's ID, I am unable to obtain any output for CiviCRM forms.
  
  Is it possible to use Drupal hooks instead of CiviCRM hooks for this purpose?
  I would greatly appreciate any assistance that anyone can provide. Thank you very much.
  
  **Tags:** drupal, hooks
  
  > **Comments:**
  > **username_1**: what sort of 'civicrm forms' are you dealing with?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2023-05-28. Score: 0
  
  The forms themselves aren't drupal forms so drupal hooks won't do anything, but you *can* put civi hook implementations in a drupal module, if you prefer using drupal modules over civi extensions.
  
  Note there is a caching/bootstrap bug where the civi hooks won't get called from a drupal module if running via command line, but they work in the UI.
  
  
  ---
  
  