diff --git a/tests/src/Context/SolutionContext.php b/tests/src/Context/SolutionContext.php index e026ed1d42..ce7e778b56 100644 --- a/tests/src/Context/SolutionContext.php +++ b/tests/src/Context/SolutionContext.php @@ -859,7 +859,7 @@ public function setDownloadCountForEntity(string $type, string $target_entity_la public function assertHighlightedSolution(string $label): void { $solution = self::getSolutionByName($label); - $block_element = $this->getSession()->getPage()->find('css', '.block-entityqueue--highlighted-content'); + $block_element = $this->getSession()->getPage()->find('css', '.block-entityqueue--highlighted-solution'); // Check block title. $actual_block_title = $block_element->find('css', 'h2')->getText(); diff --git a/web/themes/ventuno/ventuno.theme b/web/themes/ventuno/ventuno.theme index 9c4bd88093..48668ac35f 100644 --- a/web/themes/ventuno/ventuno.theme +++ b/web/themes/ventuno/ventuno.theme @@ -143,29 +143,31 @@ function ventuno_preprocess_page(&$variables) { */ function ventuno_preprocess_block(&$variables) { if ($variables['derivative_plugin_id'] == 'highlighted_solution') { - /** @var \Drupal\rdf_entity\RdfInterface $entity */ - $entity = $variables['elements']['content']['entities'][0]['#rdf_entity']; + if (isset($variables['elements']['content']['entities'][0])) { + /** @var \Drupal\rdf_entity\RdfInterface $entity */ + $entity = $variables['elements']['content']['entities'][0]['#rdf_entity']; - $topics = $entity->get('field_topic')->getValue(); + $topics = $entity->get('field_topic')->getValue(); - $options = [ - 'query' => - [ - 'f' => + $options = [ + 'query' => [ - 'type:' . $entity->bundle(), - 'topic:' . reset($topics)["target_id"], + 'f' => + [ + 'type:' . $entity->bundle(), + 'topic:' . reset($topics)["target_id"], + ], ], - ], - ]; - $variables['related_content'] = [ - '#type' => 'link', - '#title' => t('Related content'), - '#url' => Url::fromRoute('view.search.page_1', [], $options), - '#attributes' => [ - 'class' => ['more-link'], - ], - ]; + ]; + $variables['related_content'] = [ + '#type' => 'link', + '#title' => t('Related content'), + '#url' => Url::fromRoute('view.search.page_1', [], $options), + '#attributes' => [ + 'class' => ['more-link'], + ], + ]; + } } }