Details
-
Bug
-
Resolution: Fixed
-
Major
-
2.4.6, 2.5.2
-
MOODLE_24_STABLE, MOODLE_25_STABLE
-
MOODLE_25_STABLE, MOODLE_26_STABLE
-
Description
If a question contains some embedded file with a non empty path(tested on non legacy files but I will test for legacy files later), the resulting Moodle XML file is broken because the path is included in the text for instance
<img src="@@PLUGINFILE@@/images/mcq3.jpg" />
|
<file name="mcq3.jpg" encoding="base64">/9j/4AAQ...
|
So if you import this file back, you get missing images in questions.
I think the problem is caused by this line : http://git.moodle.org/gw?p=moodle.git;a=blob;f=question/format/xml/format.php;h=1c2edafdd2e62ebb53bf397cc41ea26b741a2d12;hb=HEAD#l1091 but I am at work so I will submit a fix later.
I am quite sure master branch is affected but is it not the only one because the website where I discovered the problem is running Moodle 2.4.5. I am not sure when these non legacy images with subdirs were created (this website started as Moodle 1.3 and was upgraded since) but obviously if it happen on one of my websites it can happen elsewhere so I think we must make a fix for all supported stable branches.