avoid calling subtotals substitutions if not compatible (#38653)

This commit is contained in:
Frédéric FRANCE 2026-06-09 11:37:22 +02:00 committed by GitHub
parent 79585c993a
commit f2d80a2de8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -30,7 +30,7 @@
*/
function subtotals_completesubstitutionarray_lines(&$substitutionarray, $langs, $object, $line)
{
if (defined('SUBTOTALS_SPECIAL_CODE')) {
if (defined('SUBTOTALS_SPECIAL_CODE') && property_exists($object, 'ALLOWED_TYPES') && (in_array($object->element, $object::$ALLOWED_TYPES))) {
$substitutionarray['is_subtotals_line'] = ($line->special_code == constant('SUBTOTALS_SPECIAL_CODE'));
$substitutionarray['is_not_subtotals_line'] = !$substitutionarray['is_subtotals_line'];
$substitutionarray['is_subtotals_title'] = (($line->special_code == constant('SUBTOTALS_SPECIAL_CODE')) && $line->qty > 0);