Files
dolibarr/htdocs/variants
minimexat b74c6d3ee0 FIX PHP 8.1 undefined array key warnings in ProductCombination multiprices loop (#37142)
When PRODUIT_MULTIPRICES is enabled and a product variant's parent has
multiprices configured, the updateChildPrice() method iterates through
all price levels up to PRODUIT_MULTIPRICES_LIMIT. For price levels that
don't have prices defined, accessing $parent->multiprices[$i] and
related arrays directly causes 'undefined array key' warnings on
PHP 8.1+.

Changes:
- Add isset() check before comparing $parent->multiprices[$i]
- Use isset() ternary for $parent->multiprices_min[$i] (default: 0)
- Use !empty() for $parent->prices_by_qty_list[$i] check
- Use isset() ternary for $parent->multiprices_ttc[$i] (default: 0)
- Use isset() ternary for second $parent->multiprices[$i] (default: 0)

Co-authored-by: f-hoedl <hoefla14@htl-kaindorf.ac.at>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-02-08 20:02:02 +01:00
..
2025-10-17 02:31:07 +02:00
2026-01-07 19:01:54 +01:00
2025-10-17 02:31:07 +02:00
2026-01-19 17:29:02 +01:00
2025-11-18 11:41:28 +01:00