mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix: Prevent invalid foreach() on extrafields label in product/price.php
- Ensured $extralabels is always an array before looping to prevent warnings. - Fixes "foreach() argument must be of type array|string given" error. - Improves stability when handling extrafields.
This commit is contained in:
parent
5e47f63c8b
commit
2358dc81a6
|
|
@ -1539,7 +1539,7 @@ if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUS
|
|||
|
||||
// Extrafields
|
||||
$extrafields->fetch_name_optionals_label("product");
|
||||
$extralabels = !empty($extrafields->attributes["product"]['label']) ? $extrafields->attributes["product"]['label'] : '';
|
||||
$extralabels = !empty($extrafields->attributes["product"]['label']) ? $extrafields->attributes["product"]['label'] : [];
|
||||
$extrafield_values = $extrafields->getOptionalsFromPost("product");
|
||||
$sql = "SELECT";
|
||||
$sql .= " fk_object";
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user