Merge pull request #22627 from noec764/14_FIX_Invoice_Order_FetchLines

FIX: Missing return 0 if object not found
This commit is contained in:
Laurent Destailleur 2022-10-24 19:45:41 +02:00 committed by GitHub
commit 290d02c0df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -4200,6 +4200,12 @@ class OrderLine extends CommonOrderLine
$result = $this->db->query($sql);
if ($result) {
$objp = $this->db->fetch_object($result);
if (!$objp) {
$this->error = 'OrderLine with id '. $rowid .' not found sql='.$sql;
return 0;
}
$this->rowid = $objp->rowid;
$this->id = $objp->rowid;
$this->fk_commande = $objp->fk_commande;

View File

@ -5812,6 +5812,11 @@ class FactureLigne extends CommonInvoiceLine
if ($result) {
$objp = $this->db->fetch_object($result);
if (!$objp) {
$this->error = 'InvoiceLine with id '. $rowid .' not found sql='.$sql;
return 0;
}
$this->rowid = $objp->rowid;
$this->id = $objp->rowid;
$this->fk_facture = $objp->fk_facture;