mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 04:23:19 +00:00
Fix PR
This commit is contained in:
@@ -272,18 +272,22 @@ class Query implements ControllerProviderInterface
|
||||
*/
|
||||
public function queryAnswerTrain(Application $app, Request $request)
|
||||
{
|
||||
$searchEngine = null;
|
||||
|
||||
if (($options = unserialize($request->request->get('options_serial', ''))) !== false) {
|
||||
$searchEngine = new \searchEngine_adapter($app);
|
||||
$searchEngine->set_options($options);
|
||||
if (null === $optionsSerial = $request->request->get('options_serial')) {
|
||||
$app->abort(400, 'Search engine options are missing');
|
||||
}
|
||||
|
||||
$pos = (int) $request->request->get('pos');
|
||||
if (($options = unserialize($optionsSerial)) !== false) {
|
||||
$searchEngine = new \searchEngine_adapter($app);
|
||||
$searchEngine->set_options($options);
|
||||
} else {
|
||||
$app->abort(400, 'Provided search engine options are not valid');
|
||||
}
|
||||
|
||||
$pos = (int) $request->request->get('pos', 1);
|
||||
$query = $request->request->get('query', '');
|
||||
|
||||
$record = new \record_preview($app, 'RESULT', $pos, '', '', $searchEngine, $query);
|
||||
|
||||
|
||||
return $app->json(array(
|
||||
'current' => $app['twig']->render('prod/preview/result_train.html.twig', array(
|
||||
'records' => $record->get_train($pos, $query, $searchEngine),
|
||||
|
@@ -2121,7 +2121,7 @@ function activeIcons()
|
||||
$('.TOOL_chgstatus_btn').live('click', function(){
|
||||
var params = {};
|
||||
var $this = $(this);
|
||||
console.log(p4.Results.Selection.length());
|
||||
|
||||
if ($this.hasClass('results_window')) {
|
||||
if (p4.Results.Selection.length() > 0) {
|
||||
params.lst = p4.Results.Selection.serialize();
|
||||
|
Reference in New Issue
Block a user