PrestaShop/PrestaShop — pull request #2178 by k-halaburda (2014-10-08 11:31:42+00:00)
Title: 1.6.0.10 Ajax search warnings

Hi there,
I didn't find the issue in pull requests so I add one:

In controllers/front/SearchController.php line 64

$searchResults = Search::find((int)(Tools::getValue('id_lang')), $query, 1, 10, 'position', 'desc', true);
foreach ($searchResults as &$product)
$product['product_link'] = $this->context->link->getProductLink($product['id_product'], $product['prewrite'], $product['crewrite']);
die(Tools::jsonEncode($searchResults));

triggers a warning because Search::find returns

return array('total' => $total,'result' => $result_properties);

the code should be

$searchResults = Search::find((int)(Tools::getValue('id_lang')), $query, 1, 10, 'position', 'desc', true);
foreach ($searchResults['result'] as &$product)