Loading ga.install +0 −46 Original line number Diff line number Diff line Loading @@ -5,52 +5,6 @@ * Contains ga module installation and update hooks. */ use Drupal\Core\StringTranslation\TranslatableMarkup; /** * Implements hook_requirements(). */ function ga_requirements($phase) { $requirements = []; if ($phase == 'runtime' && \Drupal::moduleHandler()->moduleExists('gacsp')) { $requirements['ga_gacsp'] = [ 'severity' => REQUIREMENT_WARNING, 'title' => new TranslatableMarkup('gacsp module'), 'value' => new TranslatableMarkup('Enabled'), 'description' => new TranslatableMarkup('To prevent duplicate tracking, Googalytics will not activate until gacsp module is uninstalled.'), ]; } return $requirements; } /** * Implements hook_install(). */ function ga_install() { _ga_copy_gacsp_config(); } /** * Copy config from gacsp if available. */ function _ga_copy_gacsp_config() { $gacspConfig = \Drupal::configFactory() ->getEditable('gacsp.settings') ->getRawData(); if (!empty($gacspConfig)) { \Drupal::configFactory()->getEditable('ga.settings') ->setData($gacspConfig) ->set('premium', FALSE) ->set('sample_rate', 100) ->set('site_speed_sample_rate', 1) ->set('force_ssl', FALSE) ->save(); } } /** * Add premium flag to configuration. */ Loading ga.module +0 −5 Original line number Diff line number Diff line Loading @@ -13,11 +13,6 @@ use Drupal\ga\Event\CollectEvent; */ function ga_page_attachments(array &$attachments) { // Don't execute until gacsp module is uninstalled. if (\Drupal::moduleHandler()->moduleExists('gacsp')) { return; } /** @var \Drupal\ga\Event\CollectEvent $event */ $event = \Drupal::service('event_dispatcher') ->dispatch(new CollectEvent(), AnalyticsEvents::COLLECT); Loading Loading
ga.install +0 −46 Original line number Diff line number Diff line Loading @@ -5,52 +5,6 @@ * Contains ga module installation and update hooks. */ use Drupal\Core\StringTranslation\TranslatableMarkup; /** * Implements hook_requirements(). */ function ga_requirements($phase) { $requirements = []; if ($phase == 'runtime' && \Drupal::moduleHandler()->moduleExists('gacsp')) { $requirements['ga_gacsp'] = [ 'severity' => REQUIREMENT_WARNING, 'title' => new TranslatableMarkup('gacsp module'), 'value' => new TranslatableMarkup('Enabled'), 'description' => new TranslatableMarkup('To prevent duplicate tracking, Googalytics will not activate until gacsp module is uninstalled.'), ]; } return $requirements; } /** * Implements hook_install(). */ function ga_install() { _ga_copy_gacsp_config(); } /** * Copy config from gacsp if available. */ function _ga_copy_gacsp_config() { $gacspConfig = \Drupal::configFactory() ->getEditable('gacsp.settings') ->getRawData(); if (!empty($gacspConfig)) { \Drupal::configFactory()->getEditable('ga.settings') ->setData($gacspConfig) ->set('premium', FALSE) ->set('sample_rate', 100) ->set('site_speed_sample_rate', 1) ->set('force_ssl', FALSE) ->save(); } } /** * Add premium flag to configuration. */ Loading
ga.module +0 −5 Original line number Diff line number Diff line Loading @@ -13,11 +13,6 @@ use Drupal\ga\Event\CollectEvent; */ function ga_page_attachments(array &$attachments) { // Don't execute until gacsp module is uninstalled. if (\Drupal::moduleHandler()->moduleExists('gacsp')) { return; } /** @var \Drupal\ga\Event\CollectEvent $event */ $event = \Drupal::service('event_dispatcher') ->dispatch(new CollectEvent(), AnalyticsEvents::COLLECT); Loading