From cabdee496be7c61b525fe2bee340efa92879e7f4 Mon Sep 17 00:00:00 2001 From: evarisk-kilyan Date: Sun, 14 Jun 2026 01:09:00 +0200 Subject: [PATCH] Qual: Fix PHPStan warning (undefined variable $maxlength) in recruitmentcandidature_list.php (#38772) PHPStan level 9 (apstats config) reports at line 444: "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/recruitmentcandidature_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index ec094c86f3a..3f9ec5c8bb2 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -441,7 +441,7 @@ if ($jobposition->id > 0 && (empty($action) || ($action != 'edit' && $action != $morehtmlref .= '
'; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects(0, (string) $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects(0, (string) $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref .= ''; $morehtmlref .= '
'; } else {