diff --git a/src/Plugin/Block/TagCloudBlock.php b/src/Plugin/Block/TagCloudBlock.php index cc5b883..ab34a83 100644 --- a/src/Plugin/Block/TagCloudBlock.php +++ b/src/Plugin/Block/TagCloudBlock.php @@ -120,14 +120,13 @@ class TagCloudBlock extends BlockBase implements ContainerFactoryPluginInterface $vocabulary_terms = $this->term_storage->loadTree($vid); foreach ($vocabulary_terms as $term) { // Checking tags which has attached contents. - $db_conn = \Drupal::database(); - $query = $db_conn->select('taxonomy_index', 'ti'); + $query = \Drupal::database()->select('taxonomy_index', 'ti'); $query->fields('ti', ['nid']); $query->join('taxonomy_term_field_data', 'ttfd', 'ttfd.tid = ti.tid'); $query->condition('ttfd.vid', $vid); $query->condition('ti.tid', $term->tid); $data = $query->execute()->fetchField(); - if(!empty($data)) { + if (!empty($data)) { $term = $this->term_storage->load($term->tid); $url = $this->token_service->replace( $config['redirect_url'],