Skip to content
Snippets Groups Projects
Commit c205a523 authored by Steven Bellens's avatar Steven Bellens Committed by Alberto Siles
Browse files

Issue #3131894 by bellenss: Taxonomy term error if It does not exist

parent 12ddb0d4
No related branches found
No related tags found
No related merge requests found
......@@ -63,8 +63,10 @@ function bootstrap_barrio_preprocess_html(&$variables) {
$path_args[0] == 'taxonomy' && $path_args[1] == 'term') {
$variables['attributes']['class'][] = 'page-taxonomy-term-' . $path_args[2];
$term = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->load($path_args[2]);
$vocabulary_id = $term->bundle();
$variables['attributes']['class'][] = 'page-vocabulary-' . Html::cleanCssIdentifier($vocabulary_id);
if (!empty($term)) {
$vocabulary_id = $term->bundle();
$variables['attributes']['class'][] = 'page-vocabulary-' . Html::cleanCssIdentifier($vocabulary_id);
}
}
$view_id = \Drupal::routeMatch()->getParameter('view_id');
if ($view_id) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment