From e460b8846da342c8ffc0c9bfd6733d31dbff5f7d Mon Sep 17 00:00:00 2001 From: Tim Lock Date: Wed, 23 Nov 2011 12:50:55 +1030 Subject: [PATCH] MDL-30419: IMS package content missing when using Blackboard packages --- mod/imscp/locallib.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mod/imscp/locallib.php b/mod/imscp/locallib.php index 522cc545bb1..938e283dfa6 100644 --- a/mod/imscp/locallib.php +++ b/mod/imscp/locallib.php @@ -139,9 +139,17 @@ function imscp_parse_structure($imscp, $context) { $xmlbase = ''; } if (!$href = $res->attributes->getNamedItem('href')) { - continue; + // If href not found look for + $fileresources = $res->getElementsByTagName('file'); + foreach ($fileresources as $file) { + $href = $file->getAttribute('href'); + } + if (empty($href)) { + continue; + } + } else { + $href = $href->nodeValue; } - $href = $href->nodeValue; if (strpos($href, 'http://') !== 0) { $href = $xmlbase.$href; }