Skip to content
Snippets Groups Projects
Commit a91ec39b authored by Sidharth Soman's avatar Sidharth Soman Committed by Bauke Visser
Browse files

Issue #3374641 by sidharth_soman: Vocabulary::load calls should be avoided in...

Issue #3374641 by sidharth_soman:  Vocabulary::load calls should be avoided in classes, use dependency injection instead
parent 8299a925
Branches
Tags 8.x-1.22
No related merge requests found
......@@ -44,10 +44,7 @@
if (typeof $explanation === 'undefined') {
const $explanation = document.createElement('div');
$explanation.classList.add('filter-tooltips-explanation', 'open');
const content = document.createTextNode($tooltip.dataset.explanation);
$explanation.appendChild(content);
$explanation.innerHTML = $tooltip.dataset.explanation;
$tooltip.appendChild($explanation);
}
else {
......
......@@ -156,7 +156,7 @@ class FilterTooltips extends FilterBase implements ContainerFactoryPluginInterfa
*/
public function process($text, $langcode) {
$vocabulary_vid = $this->settings['filter_tooltips_vocabulary'];
$vocabulary = Vocabulary::load($vocabulary_vid);
$vocabulary = $this->entityTypeManager->getStorage('taxonomy_vocabulary')->load($vocabulary_vid);
if (empty($vocabulary)) {
$result = new FilterProcessResult($text);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment