Merge pull request #22080 from atm-gauthier/fix_fk_expedition_missing_in_updateline

FIX : fk_expedition in $line can be usefull for triggers
This commit is contained in:
Laurent Destailleur 2022-09-07 13:26:34 +02:00 committed by GitHub
commit c2772aab8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -540,6 +540,7 @@ if (empty($reshook)) {
$object->fetch($id);
$lines = $object->lines;
$line = new ExpeditionLigne($db);
$line->fk_expedition = $object->id;
$num_prod = count($lines);
for ($i = 0; $i < $num_prod; $i++) {
@ -581,6 +582,7 @@ if (empty($reshook)) {
for ($i = 0; $i < $num_prod; $i++) {
if ($lines[$i]->id == $line_id) { // we have found line to update
$line = new ExpeditionLigne($db);
$line->fk_expedition = $object->id;
// Extrafields Lines
$line->array_options = $extrafields->getOptionalsFromPost($object->table_element_line);