Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Commit

Permalink
[SDPTA-1159] Revert changes causing content-vic performance issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-yao authored Aug 1, 2024
1 parent 26e4ef6 commit 0eec096
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions tide_demo_content.install
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function tide_demo_content_install() {
$department = [1459];
/** @var \Drupal\tide_site\TideSiteHelper $site_helper */
$site_helper = \Drupal::service('tide_site.helper');
$sites = _tide_demo_content_get_all_sections();
$sites = $site_helper->getAllSites();
$user_ids = \Drupal::entityQuery('user')
->condition('name', $usernames, 'IN')
->sort('uid', 'ASC')
Expand Down Expand Up @@ -115,25 +115,3 @@ function tide_demo_content_uninstall() {
$repository->removeTrackedEntities();
\Drupal::messenger()->addMessage('Removed all demo content.');
}

/**
* Get all sites and site sections.
*/
function _tide_demo_content_get_all_sections() {
$sites = [];

try {

$terms = \Drupal::entityTypeManager()->getStorage('taxonomy_term')
->loadByProperties(['vid' => 'sites']);

foreach ($terms as $site) {
$sites[$site->id()] = $site;
}
}
catch (\Exception $exception) {
watchdog_exception('tide_site', $exception);
}

return $sites;
}

0 comments on commit 0eec096

Please sign in to comment.