From 004840f435e112f7db0ae2f2308998ad5bb4b662 Mon Sep 17 00:00:00 2001 From: NicoDucou Date: Wed, 4 Oct 2023 12:10:03 +0200 Subject: [PATCH] Skill: Only send message to studentBoss if children_auto_threshold is set -refs BT#21083 --- public/main/skills/assign.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/public/main/skills/assign.php b/public/main/skills/assign.php index ca4928f027..9a251cfcd1 100644 --- a/public/main/skills/assign.php +++ b/public/main/skills/assign.php @@ -304,10 +304,9 @@ if ($form->validate()) { $parentData = $skillModel->get($parentId); $data = $extraFieldValue->get_values_by_handler_and_field_variable($parentId, 'children_auto_threshold'); - $sendEmail = true; - if ($sendEmail) { - // Search X children - $requiredSkills = isset($data['value']) ? (int) $data['value'] : 0; + // Search X children + $requiredSkills = isset($data['value']) ? (int) $data['value'] : 0; + if ($requiredSkills > 0) { $children = $skillRelSkill->getChildren($parentId); $counter = 0; foreach ($children as $child) {