Merge pull request #12156 from ATM-Marc/FIX_8.0_replenish_resql

FIX: stock replenish: fetching and freeing non existing SQL result set
This commit is contained in:
Laurent Destailleur 2019-10-17 17:40:24 +02:00 committed by GitHub
commit 9cd2406d50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -137,7 +137,6 @@ if ($action == 'order' && isset($_POST['valid']))
if ($qty) if ($qty)
{ {
//might need some value checks //might need some value checks
$obj = $db->fetch_object($resql);
$line = new CommandeFournisseurLigne($db); $line = new CommandeFournisseurLigne($db);
$line->qty = $qty; $line->qty = $qty;
$line->fk_product = $idprod; $line->fk_product = $idprod;
@ -176,7 +175,7 @@ if ($action == 'order' && isset($_POST['valid']))
$error=$db->lasterror(); $error=$db->lasterror();
dol_print_error($db); dol_print_error($db);
} }
$db->free($resql);
unset($_POST['fourn' . $i]); unset($_POST['fourn' . $i]);
} }
unset($_POST[$i]); unset($_POST[$i]);