From bd67664569c9b70e63cd6ecaf48ade40d35ce121 Mon Sep 17 00:00:00 2001 From: evarisk-kilyan Date: Sun, 14 Jun 2026 01:08:20 +0200 Subject: [PATCH] Qual: Fix PHPStan warning (undefined variable $maxlength) in recruitmentjobposition_applications.php (#38773) PHPStan level 9 (apstats config) reports at line 233: "Variable $maxlength might not be defined." $maxlength was never defined in this file and was passed as the 4th argument (max label length) of FormProjets::select_projects(). An undefined variable evaluates to null, and dol_trunc() returns the string unchanged when its size argument is empty (null or 0). Passing 0 explicitly keeps the exact same behaviour (no truncation) and removes the undefined-variable warning. Co-authored-by: Muvikx --- htdocs/recruitment/recruitmentjobposition_applications.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/recruitment/recruitmentjobposition_applications.php b/htdocs/recruitment/recruitmentjobposition_applications.php index a515d71b960..e606f8545e1 100644 --- a/htdocs/recruitment/recruitmentjobposition_applications.php +++ b/htdocs/recruitment/recruitmentjobposition_applications.php @@ -230,7 +230,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref .= '
'; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, (string) $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects($object->socid, (string) $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref .= ''; $morehtmlref .= '
'; } else {