Skip to content

Commit

Permalink
ACMS-1944: Removed hook_modules_installed() & hook_modules_uninstalle…
Browse files Browse the repository at this point in the history
…d() as it's not required.
  • Loading branch information
vishalkhode1 committed Sep 11, 2023
1 parent 4eb4083 commit 4344302
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions acquia_cms.profile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@

use Acquia\DrupalEnvironmentDetector\AcquiaDrupalEnvironmentDetector as Environment;
use Acquia\Utility\AcquiaTelemetry;
use Drupal\acquia_cms\Facade\TelemetryFacade;
use Drupal\acquia_cms\Form\SiteConfigureForm;
use Drupal\Core\Installer\InstallerKernel;
use Symfony\Component\Console\Output\ConsoleOutput;

/**
Expand Down Expand Up @@ -166,42 +164,6 @@ function install_acms_site_studio_packages() {
drush_backend_batch_process();
}

/**
* Implements hook_modules_installed().
*/
function acquia_cms_modules_installed(array $modules) : void {
// Don't do anything during site installation, since that can break things in
// a big way if modules are being installed due to changes made on the site
// configuration form.
if (InstallerKernel::installationAttempted()) {
return;
}

$module_handler = Drupal::moduleHandler();

if ($module_handler->moduleExists('acquia_telemetry')) {
Drupal::classResolver(TelemetryFacade::class)->modulesInstalled($modules);
}

if ($module_handler->moduleExists('cohesion_sync')) {
$sitestudio_version = \Drupal::service('extension.list.module')->getExtensionInfo('cohesion')['version'];
$arguments = (version_compare($sitestudio_version, '8.x-7.1.2') >= 0) ? [
$modules,
FALSE,
] : [$modules];
$module_handler->invoke('cohesion_sync', 'modules_installed', $arguments);
}
}

/**
* Implements hook_modules_uninstalled().
*/
function acquia_cms_modules_uninstalled(array $modules) {
if (\Drupal::service('module_handler')->moduleExists('acquia_telemetry')) {
Drupal::classResolver(TelemetryFacade::class)->modulesUninstalled($modules);
}
}

/**
* Method that calls another method to capture the installation end time.
*/
Expand Down

0 comments on commit 4344302

Please sign in to comment.