Skip to content

Commit

Permalink
UHF-9530: Get keywords with correct language
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrsky committed Mar 11, 2024
1 parent 2a39242 commit eb5efa3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hdbt.theme
Original file line number Diff line number Diff line change
Expand Up @@ -1643,10 +1643,14 @@ function hdbt_preprocess_paragraph__event_list(&$variables): void {
$settings['field_event_count'] = '3';
}

$langcode = \Drupal::languageManager()
->getCurrentLanguage()
->getId();

$settings['field_filter_keywords'] = array_map(static fn ($term) => [
'id' => $term->get('field_keyword_id')->getString(),
'name' => $term->getName(),
], $paragraph->getFilterKeywords());
], $paragraph->getFilterKeywords($langcode));

if ($paragraph->hasField('field_api_url') && !$paragraph->get('field_api_url')->isEmpty()) {
$linkedEvents = Drupal::service('helfi_react_search_linked_events');
Expand Down

0 comments on commit eb5efa3

Please sign in to comment.