From b15fade0fe132e3dea03d14cc1d0d9fd8cf47cb5 Mon Sep 17 00:00:00 2001 From: Damien Alexandre Date: Tue, 7 Oct 2014 11:05:14 +0200 Subject: [PATCH] Fix the UniqueCollection fetcher --- .../Phrasea/SearchEngine/Elastic/RecordHelper.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/RecordHelper.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/RecordHelper.php index d5a30c40be..85fb81dea2 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/RecordHelper.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/RecordHelper.php @@ -32,7 +32,16 @@ class RecordHelper public function getUniqueCollectionId($databoxId, $collectionId) { - return igorw\get_in($this->collectionMap(), [$databoxId, $collectionId]); + $col = $this->collectionMap(); + + if (isset($col[$databoxId])) { + $index = array_search($collectionId, $col[$databoxId]); + if ($index !== false) { + return (int) $index; + } + } + + return null; } private function collectionMap()