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

Commit

Permalink
fix(php): Merge pull request #81 from svicervlad/RGTC-1923
Browse files Browse the repository at this point in the history
[RGTC-1923] Clear log messages
  • Loading branch information
podarok authored Aug 23, 2021
2 parents 55c8c7a + ae7a07e commit be04b70
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/OpenyActivityFinderSolrBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function runProgramSearch($parameters, $log_id) {
$locations[$key]['count'] = 0;
foreach ($group['value'] as $location) {
foreach ($data['facets']['locations'] as $fl) {
if ($fl['id'] == $location['value']) {
if (isset($fl['id']) && isset($location['value']) && $fl['id'] == $location['value']) {
$locations[$key]['count'] += $fl['count'];
}
}
Expand Down Expand Up @@ -489,7 +489,10 @@ public function getFacets($results) {
// For some reason if location doesn't contain any session
// in filter we have '!' instead of location name.
if (!empty($item['filter']) && $item['filter'] != '!') {
$facets_m[$f][$i]['id'] = $locationsInfo[str_replace('"', '', $item['filter'])]['nid'];
$location_title = str_replace('"', '', $item['filter']);
if (isset($locationsInfo[$location_title])) {
$facets_m[$f][$i]['id'] = $locationsInfo[$location_title]['nid'];
}
}
}
if ($f == 'field_activity_category') {
Expand Down Expand Up @@ -843,7 +846,7 @@ public function convertData($ages = []) {
if (isset($ages[$i + 1]) && $ages[$i + 1] == 0) {
$plus = ' + ';
}
$ages_y[$i] = $ages[$i] . \Drupal::translation()->formatPlural($ages_y[$i], ' month', ' months' . $plus);
$ages_y[$i] = $ages[$i] . \Drupal::translation()->formatPlural($ages[$i], ' month', ' months' . $plus);
}
else {
if ($ages[$i] == 0 && $ages[$i + 1]) {
Expand Down

0 comments on commit be04b70

Please sign in to comment.