diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5c275743035..000f14ee59f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1330,7 +1330,18 @@ class Form } } - function _construct_product_list_option(&$objp, &$opt, &$optJson, $price_level, $selected) { + /** + * _construct_product_list_option + * + * @param resultset &$objp Resultset of fetch + * @param string $opt Option + * @param string $optJson Option + * @param int $price_level Price level + * @param string $selected Preselected value + * @return + */ + private function _construct_product_list_option(&$objp, &$opt, &$optJson, $price_level, $selected) + { global $langs,$conf,$user,$db; $outkey=''; @@ -1348,7 +1359,7 @@ class Form $label=$objp->label; if (! empty($objp->label_translated)) $label=$objp->label_translated; - if ($filterkey && $filterkey != '') $label=preg_replace('/('.preg_quote($filterkey).')/i','$1',$label,1); + if (! empty($filterkey) && $filterkey != '') $label=preg_replace('/('.preg_quote($filterkey).')/i','$1',$label,1); $outkey=$objp->rowid; $outref=$objp->ref; @@ -1368,7 +1379,7 @@ class Form $opt.= $objp->ref.' - '.dol_trunc($label,32).' - '; $objRef = $objp->ref; - if ($filterkey && $filterkey != '') $objRef=preg_replace('/('.preg_quote($filterkey).')/i','$1',$objRef,1); + if (! empty($filterkey) && $filterkey != '') $objRef=preg_replace('/('.preg_quote($filterkey).')/i','$1',$objRef,1); $outval.=$objRef.' - '.dol_trunc($label,32).' - '; $found=0; diff --git a/htdocs/core/tpl/ajaxrow.tpl.php b/htdocs/core/tpl/ajaxrow.tpl.php index d68956e0e6f..398ca6e008f 100644 --- a/htdocs/core/tpl/ajaxrow.tpl.php +++ b/htdocs/core/tpl/ajaxrow.tpl.php @@ -25,7 +25,7 @@ $id=$object->id; $fk_element=$object->fk_element; $table_element_line=$object->table_element_line; $nboflines=(isset($object->lines)?count($object->lines):(isset($tasksarray)?count($tasksarray):0)); -$forcereloadpage=$conf->global->MAIN_FORCE_RELOAD_PAGE; +$forcereloadpage=empty($conf->global->MAIN_FORCE_RELOAD_PAGE)?0:1; if (GETPOST('action') != 'editline' && $nboflines > 1) { ?>