diff --git a/htdocs/admin/remotestore/class/externalModules.class.php b/htdocs/admin/remotestore/class/externalModules.class.php index 9c0454f217c..6cd9d48f899 100644 --- a/htdocs/admin/remotestore/class/externalModules.class.php +++ b/htdocs/admin/remotestore/class/externalModules.class.php @@ -372,22 +372,7 @@ class ExternalModules $this->numberTotalOfPages = (int) ceil(max($fileProductsTotal / $this->per_page, $dolistoreProductsTotal / $this->per_page)); // merge both sources - $this->products = array_values(array_merge($dolistoreProducts, $fileProducts)); - - // Sort products list by datec - usort( - $this->products, - /** - * Compare creation dates - * - * @param array $a First product for comparison. - * @param array $b Second product for comparison. - * @return int - */ - static function ($a, $b) { - return strtotime($b['datec'] ?? '0') - strtotime($a['datec'] ?? '0'); - } - ); + $this->products = array_values(array_merge($fileProducts, $dolistoreProducts)); $i = 0; foreach ($this->products as $product) { @@ -628,6 +613,9 @@ class ExternalModules } else { $sub = 0; } + if (!empty($this->search)) { + $param_array['search_keyword'] = $this->search; + } $param_array['no_page'] = $this->no_page - $sub; if ($this->categorie != 0) { $param_array['categorie'] = $this->categorie; @@ -651,6 +639,9 @@ class ExternalModules } else { $add = 1; } + if (!empty($this->search)) { + $param_array['search_keyword'] = $this->search; + } $param_array['no_page'] = $this->no_page + $add; if ($this->categorie != 0) { $param_array['categorie'] = $this->categorie;