Implemented a correct error handling, if the $line->product_ref has not been set
This commit is contained in:
parent
2aaf3a466d
commit
f93934905f
@ -529,10 +529,13 @@ abstract class CommonDocGenerator
|
|||||||
$resarray = $this->fill_substitutionarray_with_extrafields($line,$resarray,$extrafields,$array_key=$array_key,$outputlangs);
|
$resarray = $this->fill_substitutionarray_with_extrafields($line,$resarray,$extrafields,$array_key=$array_key,$outputlangs);
|
||||||
|
|
||||||
// Load product data optional fields to the line -> enables to use "line_options_{extrafield}"
|
// Load product data optional fields to the line -> enables to use "line_options_{extrafield}"
|
||||||
|
if (isset($line->product_ref))
|
||||||
|
{
|
||||||
$product = new Product($this->db);
|
$product = new Product($this->db);
|
||||||
$result = $product->fetch(null, $line->product_ref);
|
$result = $product->fetch(null, $line->product_ref);
|
||||||
foreach($product->array_options as $key=>$label)
|
foreach($product->array_options as $key=>$label)
|
||||||
$resarray["line_".$key] = $label;
|
$resarray["line_".$key] = $label;
|
||||||
|
}
|
||||||
|
|
||||||
return $resarray;
|
return $resarray;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user