From ab49c7bdb10df373b090b58305790155a38f41dd Mon Sep 17 00:00:00 2001 From: root Date: Wed, 14 Aug 2019 03:00:40 +0200 Subject: [PATCH] FIX b2fc8092: non trovava mai topic simili --- src/Controller/RelatedRorController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controller/RelatedRorController.php b/src/Controller/RelatedRorController.php index 27e4076..534d522 100644 --- a/src/Controller/RelatedRorController.php +++ b/src/Controller/RelatedRorController.php @@ -125,8 +125,8 @@ class RelatedRorController extends ControllerBase { } private function getSimilarity(array $orig, array $other): int { - if(!in_array('field_tags', $orig) || count($orig['field_tags']) == 0 || - !in_array('field_tags', $other) || count($other['field_tags']) == 0) { + if(!array_key_exists('field_tags', $orig) || count($orig['field_tags']) == 0 || + !array_key_exists('field_tags', $other) || count($other['field_tags']) == 0) { return 0; } $orig_tags = array_map(function($t) { return $t['target_id']; }, $orig['field_tags']);