From 4da47a790826c7ef23808aeb55640e7e4efc4537 Mon Sep 17 00:00:00 2001 From: jygaulier Date: Tue, 29 Sep 2020 19:59:26 +0200 Subject: [PATCH] - fix : include=facets now works also in extended mode --- .../Phrasea/Controller/Api/V3/V3SearchController.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/Alchemy/Phrasea/Controller/Api/V3/V3SearchController.php b/lib/Alchemy/Phrasea/Controller/Api/V3/V3SearchController.php index 2166dbe504..aa6ad2b328 100644 --- a/lib/Alchemy/Phrasea/Controller/Api/V3/V3SearchController.php +++ b/lib/Alchemy/Phrasea/Controller/Api/V3/V3SearchController.php @@ -139,6 +139,8 @@ class V3SearchController extends Controller // if ($request->get('search_type') != SearchEngineOptions::RECORD_STORY) { if(in_array('results.stories.children', $includes)) { $includes = array_merge($includes, [ + 'results.stories.caption', + 'results.stories.metadata', 'results.stories.children.subdefs', 'results.stories.children.metadata', 'results.stories.children.caption', @@ -146,7 +148,9 @@ class V3SearchController extends Controller ]); } else { - $includes = [ 'results.stories.caption' ]; + $includes = array_merge($includes, [ + 'results.stories.caption' + ]); } $includes = array_merge($includes, [ @@ -265,7 +269,7 @@ class V3SearchController extends Controller $allChildren[$index] = $childrenView->getRecord(); } - $names = in_array('results.stories.records.subdefs', $includes, true) ? null : ['thumbnail']; + $names = in_array('results.stories.children.subdefs', $includes, true) ? null : ['thumbnail']; $subdefViews = $this->buildSubdefsViews($allChildren, $names, $urlTTL); $technicalDatasets = $this->app['service.technical_data']->fetchRecordsTechnicalData($allChildren); @@ -274,7 +278,7 @@ class V3SearchController extends Controller $recordView->setTechnicalDataView(new TechnicalDataView($technicalDatasets[$index])); } - if (array_intersect($includes, ['results.stories.records.metadata', 'results.stories.records.caption'])) { + if (array_intersect($includes, ['results.stories.children.metadata', 'results.stories.children.caption'])) { $captions = $this->app['service.caption']->findByReferenceCollection($allChildren); $canSeeBusiness = $this->retrieveSeeBusinessPerDatabox($allChildren);