FIX avoid php warnings (#35492)

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
Regis Houssin
2025-09-27 13:28:04 +02:00
committed by GitHub
parent 43e3ebde1a
commit bca094a6a8
2 changed files with 2 additions and 2 deletions

View File

@@ -795,7 +795,7 @@ if ($object->id > 0 || !empty($object->ref)) {
print '</td>'; // Dispatch column
print '<td></td>'; // Warehouse column
$sql = "SELECT ed.rowid";
$sql = "SELECT ed.rowid, ed.fk_parent";
$sql .= ", cd.fk_product";
$sql .= ", ".$db->ifsql('eb.rowid IS NULL', 'ed.qty', 'eb.qty')." as qty";
$sql .= ", ".$db->ifsql('eb.rowid IS NULL OR eb.fk_warehouse IS NULL', 'ed.fk_entrepot', 'eb.fk_warehouse')." as fk_warehouse";

View File

@@ -536,7 +536,7 @@ if (!empty($id) || !empty($ref)) {
if ($action == 'add') {
$prodattr_all = $prodattr->fetchAll();
if (!$selected) {
if (!$selected && !empty($prodattr_all)) {
$selected = $prodattr_all[key($prodattr_all)]->id;
}