X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Ftaxonomy%2Fsrc%2FVocabularyStorage.php;h=ce90189b582688322c0c18ed3d10049d962c7878;hb=5b8bb166bfa98770daef9de5c127fc2e6ef02340;hp=bdbf8938f708e6c590958a3ccc62b391c373017e;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/modules/taxonomy/src/VocabularyStorage.php b/web/core/modules/taxonomy/src/VocabularyStorage.php index bdbf8938f..ce90189b5 100644 --- a/web/core/modules/taxonomy/src/VocabularyStorage.php +++ b/web/core/modules/taxonomy/src/VocabularyStorage.php @@ -21,7 +21,12 @@ class VocabularyStorage extends ConfigEntityStorage implements VocabularyStorage * {@inheritdoc} */ public function getToplevelTids($vids) { - return db_query('SELECT t.tid FROM {taxonomy_term_data} t INNER JOIN {taxonomy_term_hierarchy} th ON th.tid = t.tid WHERE t.vid IN ( :vids[] ) AND th.parent = 0', [':vids[]' => $vids])->fetchCol(); + $tids = \Drupal::entityQuery('taxonomy_term') + ->condition('vid', $vids, 'IN') + ->condition('parent.target_id', 0) + ->execute(); + + return array_values($tids); } }