Answers.Body: <p>You could perhaps do this with a CiviCRM extension rather than a Drupal module so you are sure it is only executed once CiviCRM is installed? Not sure if it is possible in your scenario.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-19T13:51:32.720Z
Answers.Text: Thx, will check it. I have Drupal profile, not a module, not sure if it make any difference.
Answers.UserDisplayName: Doka
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-21T12:01:29.197Z
Answers.Text: The solution to automate the removal of households from CiviCRM was to implement the Drupal hook of [hook_modules_installed](https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_modules_installed/7.x) in the .install file of my Drupal profile.
Answers.UserDisplayName: Doka
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-19T13:46:16.633Z
Answers.LastActivityDate: 2020-02-19T13:46:16.633Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>I want to automate the removal of households from CiviCRM, right after it has been installed via Aegir on Drupal 7.</p>
  
  <p>I implemented my <a href="https://docs.aegirproject.org/extend/altering-behaviours/#running-extra-code-after-a-task" rel="nofollow noreferrer">post_provision_install</a> hook, but it runs before the <a href="https://git.drupalcode.org/project/hosting_civicrm/blob/7.x-3.x/drush/install.provision.inc" rel="nofollow noreferrer">same hook of Hosting CiviCRM module</a>, means before the install of the CiviCRM module.</p>
  
  <p>How can I change the calling order of the <code>post_provision_install</code> hooks in this particular case?</p>
  
  <p>Or how can be an <code>post_hosting_install_task</code> hook implemented and called?</p>
  
Tags: <installation><hooks><aegir>
Title: How to call my post_provision_install hook after CiviCRM installed?
ThreadText: # How to call my post_provision_install hook after CiviCRM installed?
  
  (Asked by: username_0 on 2020-02-19)
  
  I want to automate the removal of households from CiviCRM, right after it has been installed via Aegir on Drupal 7.
  
  I implemented my [post\_provision\_install](https://docs.aegirproject.org/extend/altering-behaviours/#running-extra-code-after-a-task) hook, but it runs before the [same hook of Hosting CiviCRM module](https://git.drupalcode.org/project/hosting_civicrm/blob/7.x-3.x/drush/install.provision.inc), means before the install of the CiviCRM module.
  
  How can I change the calling order of the `post_provision_install` hooks in this particular case?
  
  Or how can be an `post_hosting_install_task` hook implemented and called?
  
  **Tags:** installation, hooks, aegir
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-02-19. Score: 1
  
  You could perhaps do this with a CiviCRM extension rather than a Drupal module so you are sure it is only executed once CiviCRM is installed? Not sure if it is possible in your scenario.
  
  > **Comments:**
  > **username_0**: Thx, will check it. I have Drupal profile, not a module, not sure if it make any difference.  
  > **username_0**: The solution to automate the removal of households from CiviCRM was to implement the Drupal hook of [hook_modules_installed](https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_modules_installed/7.x) in the .install file of my Drupal profile.  
  
  ---
  
  