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.

  • what sort of 'civicrm forms' are you dealing with?
    – petednz - fuzion
    May 29, 2023 at 20:20

1 Answer 1


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.