mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
Merge pull request #29 from nlegoff/pr-preview
Fix record preview in production
This commit is contained in:
@@ -221,7 +221,7 @@ class Query implements ControllerProviderInterface
|
||||
|
||||
return $app->json([
|
||||
'current' => $app['twig']->render('prod/preview/result_train.html.twig', [
|
||||
'records' => $record->get_train($pos, $query, $app['phraseanet.SE']),
|
||||
'records' => $record->get_train($pos, $query, $app['phraseanet.SE'], $options),
|
||||
'selected' => $pos
|
||||
])
|
||||
]);
|
||||
|
@@ -497,6 +497,8 @@ class SearchEngineOptions
|
||||
$options = new static();
|
||||
$options->disallowBusinessFields();
|
||||
|
||||
$sort_by = $sort_ord = null;
|
||||
|
||||
foreach ($serialized as $key => $value) {
|
||||
|
||||
switch (true) {
|
||||
@@ -530,8 +532,6 @@ class SearchEngineOptions
|
||||
break;
|
||||
}
|
||||
|
||||
$sort_by = $sort_ord = null;
|
||||
|
||||
switch ($key) {
|
||||
case 'record_type':
|
||||
$options->setRecordType($value);
|
||||
|
@@ -204,7 +204,7 @@ class record_preview extends record_adapter
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function get_train($pos = 0, $query = '', SearchEngineInterface $search_engine = null)
|
||||
public function get_train($pos = 0, $query = '', SearchEngineInterface $search_engine = null, SearchEngineOptions $options)
|
||||
{
|
||||
if ($this->train) {
|
||||
return $this->train;
|
||||
@@ -214,7 +214,7 @@ class record_preview extends record_adapter
|
||||
case 'RESULT':
|
||||
$perPage = 56;
|
||||
$index = ($pos - 3) < 0 ? 0 : ($pos - 3);
|
||||
$results = $search_engine->query($query, $index, $perPage);
|
||||
$results = $search_engine->query($query, $index, $perPage, $options);
|
||||
|
||||
$this->train = $results->getResults()->toArray();
|
||||
break;
|
||||
|
Reference in New Issue
Block a user