MDL-30419: IMS package content missing when using Blackboard packages
authorTim Lock <tim.lock@netspot.com.au>
Wed, 23 Nov 2011 02:20:55 +0000 (12:50 +1030)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 14 Dec 2011 20:36:20 +0000 (21:36 +0100)
mod/imscp/locallib.php

index 6936d4d..6eb6ebb 100644 (file)
@@ -153,9 +153,17 @@ function imscp_parse_manifestfile($manifestfilecontents) {
             $xmlbase = '';
         }
         if (!$href = $res->attributes->getNamedItem('href')) {
-            continue;
+            // If href not found look for <file href="help.htm"/>
+            $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;
         }