Fix notice if no dataset available for average score

Created on 10 July 2023, over 1 year ago

Problem/Motivation

got notices

Notice : Undefined index: datasets dans Drupal\self_evaluation\Entity\SelfEvaluationGroupment->processAverage() (/private/var/www/xxx/web/modules/contrib/self_evaluation/src/Entity/SelfEvaluationGroupment.php ligne 242) 

Notice : Trying to access array offset on value of type null dans Drupal\self_evaluation\Entity\SelfEvaluationGroupment->processAverage() (/private/var/www/xxx/web/modules/contrib/self_evaluation/src/Entity/SelfEvaluationGroupment.php ligne 242) 

Warning : Invalid argument supplied for foreach() dans Drupal\self_evaluation\Entity\SelfEvaluationGroupment->processAverage() (/private/var/www/xxx/web/modules/contrib/self_evaluation/src/Entity/SelfEvaluationGroupment.php ligne 242) 

Proposed resolution

Check dataset is not empty before looping on it.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇫🇷France flocondetoile Lyon

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024