From 6b4e22ec3cf1f75eef5c0923fafd9f942e2e9fcf Mon Sep 17 00:00:00 2001 From: atm-ph Date: Sat, 10 Jun 2017 16:07:56 +0200 Subject: [PATCH] Fix 6910 if conf PROJECT_USE_SEARCH_TO_SELECT is used we got BadFirstParameterForGETPOST --- htdocs/expedition/class/expedition.class.php | 1 + htdocs/projet/ajax/projects.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 06cddeace91..1a36f68a81a 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -195,6 +195,7 @@ class Expedition extends CommonObject // Clean parameters $this->brouillon = 1; $this->tracking_number = dol_sanitizeFileName($this->tracking_number); + if (empty($this->fk_project)) $this->fk_project = 0; $this->user = $user; diff --git a/htdocs/projet/ajax/projects.php b/htdocs/projet/ajax/projects.php index 3140352bf60..ae4c412f6e3 100644 --- a/htdocs/projet/ajax/projects.php +++ b/htdocs/projet/ajax/projects.php @@ -61,7 +61,7 @@ $idprod = (! empty($match[0]) ? $match[0] : ''); if (! GETPOST($htmlname) && ! GETPOST($idprod)) return; // When used from jQuery, the search term is added as GET param "term". -$searchkey=(GETPOST($idprod)?GETPOST($idprod):(GETPOST($htmlname)?GETPOST($htmlname):'')); +$searchkey=(!empty($idprod) && GETPOST($idprod)?GETPOST($idprod):(GETPOST($htmlname)?GETPOST($htmlname):'')); $form = new FormProjets($db); $arrayresult=$form->select_projects_list($socid, '', $htmlname, 0, 0, 1, $discard_closed, 0, 0, 1, $searchkey);