Fix 6910 if conf PROJECT_USE_SEARCH_TO_SELECT is used we got BadFirstParameterForGETPOST

This commit is contained in:
atm-ph 2017-06-10 16:07:56 +02:00
parent b6af1f7e6e
commit 6b4e22ec3c
2 changed files with 2 additions and 1 deletions

View File

@ -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;

View File

@ -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);