diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 779d29dd73a..e6efa6a1d85 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -82,11 +82,12 @@ $search_version = GETPOST('search_version', 'alpha'); // For remotestore search -$options = array(); -$options['per_page'] = 10; -$options['no_page'] = ((int) GETPOSTINT('no_page') ? GETPOSTINT('no_page') : 1); -$options['categorie'] = ((int) (GETPOSTINT('categorie') ? GETPOSTINT('categorie') : 0)); -$options['search'] = GETPOST('search_keyword', 'alpha'); +$options = array(); +$options['per_page'] = 10; +$options['no_page'] = ((int) GETPOSTINT('no_page') ? GETPOSTINT('no_page') : 1); +$options['categorie'] = ((int) (GETPOSTINT('categorie') ? GETPOSTINT('categorie') : 0)); +$options['search'] = GETPOST('search_keyword', 'alpha'); +$options['source'] = 'dolistore'; //$remotestore = new Dolistore(false); $remotestore = new ExternalModules(); diff --git a/htdocs/admin/remotestore/class/externalModules.class.php b/htdocs/admin/remotestore/class/externalModules.class.php index fc449022507..8ac467fb5e5 100644 --- a/htdocs/admin/remotestore/class/externalModules.class.php +++ b/htdocs/admin/remotestore/class/externalModules.class.php @@ -52,7 +52,7 @@ class ExternalModules */ public $shop_url; // the url of the shop /** - * @var int + * @var string */ public $lang; // the integer representing the lang in the store /** @@ -362,7 +362,7 @@ class ExternalModules */ public function buildSorter($key) { - return function ($a, $b) use ($key) { + return function (array $a, array $b) use ($key): int { return strnatcmp($a[$key], $b[$key]); }; } @@ -517,7 +517,7 @@ class ExternalModules return 'This call to the API returned an unexpected HTTP status of: ' . $request['status_code']; } - if (!empty($error_message)) { + if (!empty($error_message) && isset($error_message)) { $response = $request['response']; if (isset($response['errors']) && is_array($response['errors'])) { foreach ($response['errors'] as $error) {