Commit f340d971 authored by Vit Moravsky's avatar Vit Moravsky Committed by Joseph Olstad
Browse files

Issue #3160164 by kyberman: Add query alter support for D8

parent f289ef0b
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -87,9 +87,16 @@ class TagService implements TagServiceInterface {
  public function getTags(array $vids, $steps = 6, $size = 60, $display = NULL) {
    // Build the options so we can cache multiple versions.
    $language = $this->languageManager->getCurrentLanguage();
    $options = implode('_', $vids) . '_' . $language->getId() . '_' . $steps . '_' . $size . "_" . $display;
    $cache_name = implode(':', [
      'tagclouds',
      implode('_', $vids),
      $language->getId(),
      \Drupal::request()->getRequestUri(),
      $steps,
      $size,
      $display,
    ]);
    // Check if the cache exists.
    $cache_name = 'tagclouds_cache_' . $options;
    $cache = $this->cacheStore->get($cache_name);
    $tags = [];
    // Make sure cache has data.
@@ -131,6 +138,7 @@ class TagService implements TagServiceInterface {
      if ($size > 0) {
        $query->range(0, $size);
      }
      $query->addTag('tagclouds_get_tags');
      $result = $query->execute()->fetchAll();

      foreach ($result as $tag) {