Mercurial > hg > cmmr2012-drupal-site
diff core/modules/taxonomy/src/Plugin/EntityReferenceSelection/TermSelection.php @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | a9cd425dd02b |
children |
line wrap: on
line diff
--- a/core/modules/taxonomy/src/Plugin/EntityReferenceSelection/TermSelection.php Thu Feb 28 13:11:55 2019 +0000 +++ b/core/modules/taxonomy/src/Plugin/EntityReferenceSelection/TermSelection.php Thu May 09 15:34:47 2019 +0100 @@ -56,7 +56,7 @@ $options = []; - $bundles = $this->entityManager->getBundleInfo('taxonomy_term'); + $bundles = $this->entityTypeBundleInfo->getBundleInfo('taxonomy_term'); $bundle_names = $this->getConfiguration()['target_bundles'] ?: array_keys($bundles); $has_admin_access = $this->currentUser->hasPermission('administer taxonomy'); @@ -64,13 +64,13 @@ foreach ($bundle_names as $bundle) { if ($vocabulary = Vocabulary::load($bundle)) { /** @var \Drupal\taxonomy\TermInterface[] $terms */ - if ($terms = $this->entityManager->getStorage('taxonomy_term')->loadTree($vocabulary->id(), 0, NULL, TRUE)) { + if ($terms = $this->entityTypeManager->getStorage('taxonomy_term')->loadTree($vocabulary->id(), 0, NULL, TRUE)) { foreach ($terms as $term) { if (!$has_admin_access && (!$term->isPublished() || in_array($term->parent->target_id, $unpublished_terms))) { $unpublished_terms[] = $term->id(); continue; } - $options[$vocabulary->id()][$term->id()] = str_repeat('-', $term->depth) . Html::escape($this->entityManager->getTranslationFromContext($term)->label()); + $options[$vocabulary->id()][$term->id()] = str_repeat('-', $term->depth) . Html::escape($this->entityRepository->getTranslationFromContext($term)->label()); } } }