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>
* qual: phpdoc for ProductCombination.class.php
* use array_map to cast array values upstream
* phpdoc
* fix phan warning
Avoid function calls in a FOR loop test part
* qual fix phan warning on $object->fetch('')
TypeError PhanTypeMismatchArgumentProbablyReal Argument 1 ($id) is '' of type '' but \Product::fetch() takes int (no real type) defined at htdocs/product/class/product.class.php:2540 (the inferred real argument type has nothing in common with the parameter's phpdoc type)
htdocs/variants/class/ProductCombination.class.php 773
* Update api_categories.class.php
* Update api_categories.class.php
* Update api_products.class.php
* Update api_products.class.php
* Update combinations.php
htdocs/variants/class/ProductCombination.class.php 843 TypeError PhanTypeMismatchDimFetch When fetching an array index from a value of type array, found an array index of type int, but expected the index to be of type string
htdocs/variants/class/ProductCombination.class.php 843 TypeError PhanTypeMismatchDimFetch When fetching an array index from a value of type array, found an array index of type int, but expected the index to be of type string
htdocs/variants/class/ProductCombination.class.php 846 TypeError PhanTypeMismatchDimFetch When fetching an array index from a value of type array, found an array index of type int, but expected the index to be of type string
htdocs/variants/class/ProductCombination.class.php 846 TypeError PhanTypeMismatchDimFetch When fetching an array index from a value of type array, found an array index of type int, but expected the index to be of type string
htdocs/variants/class/ProductCombination.class.php 851 TypeError PhanTypeMismatchDimFetch When fetching an array index from a value of type array, found an array index of type int, but expected the index to be of type string
htdocs/variants/class/ProductCombination.class.php 851 TypeError PhanTypeMismatchDimFetch When fetching an array index from a value of type array, found an array index of type int, but expected the index to be of type string
* fix phpstan Property Product::$oldcopy in empty() is not falsy
* add token
* doc
* fix phpstan Property Product::$oldcopy in empty() is not falsy
* fix phpstan Property Product::$oldcopy in empty() is not falsy
* fix phpstan
# Qual: Fix spelling htdocs/[q-z]*
Probably fixes a bug:
- htdocs/webservices/server_thirdparty.php
No other occurence of adress found.
-'adress'=>->adress,- +'address'=>->address,+