Commit 54936693 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1640837: Proper import of blogposts



If we didn't wrap the blogpost description in a <div></div> it failed
to fully make the content. This is fine for our made leap2a but fails
for ones made via 3rd party systems, like moodle.

The problem was how we extracted the info from the DOM $xml

Test with the leap2a files in the bug report

behatnotneeded

Change-Id: Iedb88a05b332a38305e9304f358d3e424b1973f4
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 1d66962e
......@@ -1656,7 +1656,13 @@ class PluginImportLeap extends PluginImport {
// DOMDocument wraps the content with '<html><body></body></html>'
// so we call children() twice to remove it again
return $xml->children()->children()->asXML();
$children = $xml->children()->children();
// We need to return all children of <body> tag
$return = '';
foreach ($children as $child) {
$return .= $child->asXML();
}
return $return;
}
private function _fixref($hrefsrc) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment