FIX Get array value for arrayname in loop. (#26805)

Reported by phan: htdocs/mrp/class/api_mos.class.php:369 PhanTypeMismatchForeach 'arraytoconsume'|'arraytoproduce' passed to foreach instead of array
This commit is contained in:
MDW 2023-11-23 17:30:43 +01:00 committed by GitHub
parent a8b2c631ab
commit ff44558e36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -366,7 +366,7 @@ class Mos extends DolibarrApi
$pos = 0;
$arrayofarrayname = array("arraytoconsume","arraytoproduce");
foreach ($arrayofarrayname as $arrayname) {
foreach ($arrayname as $value) {
foreach (${$arrayname} as $value) {
$tmpproduct = new Product($this->db);
if (empty($value["objectid"])) {
throw new RestException(500, "Field objectid required in ".$arrayname);