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:
Regis Houssin 2025-11-11 20:18:00 +01:00 committed by GitHub
parent 3b38422977
commit f2e4ac5bfe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 .= '>&nbsp;</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)) {