FIX use $this->db instead $db (#36219)
* FIX use $this->db instead $db * FIX use $db with static function --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
parent
3b38422977
commit
f2e4ac5bfe
1 changed files with 3 additions and 4 deletions
|
|
@ -3041,7 +3041,6 @@ class Form
|
|||
public function select_bom($selected = '', $htmlname = 'bom_id', $limit = 0, $status = 1, $type = 0, $showempty = '1', $morecss = '', $nooutput = '', $forcecombo = 0, $TProducts = [])
|
||||
{
|
||||
// phpcs:enable
|
||||
global $db;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
||||
|
||||
|
|
@ -3072,7 +3071,7 @@ class Form
|
|||
if (!empty($limit)) {
|
||||
$sql .= ' LIMIT ' . (int) $limit;
|
||||
}
|
||||
$resql = $db->query($sql);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if ($showempty) {
|
||||
$out .= '<option value="-1"';
|
||||
|
|
@ -3081,7 +3080,7 @@ class Form
|
|||
}
|
||||
$out .= '> </option>';
|
||||
}
|
||||
while ($obj = $db->fetch_object($resql)) {
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$out .= '<option value="' . $obj->rowid . '"';
|
||||
if ($obj->rowid == $selected) {
|
||||
$out .= 'selected';
|
||||
|
|
@ -3090,7 +3089,7 @@ class Form
|
|||
}
|
||||
} else {
|
||||
$error++;
|
||||
dol_print_error($db);
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
$out .= '</select>';
|
||||
if (empty($nooutput)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue