Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Commit

Permalink
ISAICP-6765: Fix class block_element higlight content.
Browse files Browse the repository at this point in the history
  • Loading branch information
saidatom committed Oct 20, 2021
1 parent b7bdcb4 commit c31c06e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion tests/src/Context/SolutionContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
40 changes: 21 additions & 19 deletions web/themes/ventuno/ventuno.theme
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
],
];
}
}
}

Expand Down

0 comments on commit c31c06e

Please sign in to comment.