MDL-76376 scorm: fix PHP8 TypeError (null is not Countable)

This commit is contained in:
Mark Holliday 2022-11-20 16:59:12 -05:00 committed by Jonathan Champ
parent 57c1e97bf1
commit 3476cccf38

View File

@ -568,7 +568,7 @@ function scorm_parse_scorm(&$scorm, $manifest) {
$scoes = scorm_get_manifest($manifests, $scoes);
$newscoes = array();
$sortorder = 0;
if (count($scoes->elements) > 0) {
if (!empty($scoes->elements) && is_iterable($scoes->elements)) {
$olditems = $DB->get_records('scorm_scoes', array('scorm' => $scorm->id));
foreach ($scoes->elements as $manifest => $organizations) {
foreach ($organizations as $organization => $items) {