Do not try to convert activity modules that do not have the converter implemented yet

This checks for the presence of moodle1 library in the module directory.
If there is no such file, the converter does not include the module in
the list of included modules.

Note that some files (like module.xml) are created for such skipped
modules anyway. But restore process seems to use the information from
moodle_backup.xml so it does not try to restore them.
This commit is contained in:
David Mudrak
2011-05-19 14:25:37 +02:00
parent 317f1c6f61
commit 2304cbaacd
+9 -2
View File
@@ -515,8 +515,15 @@ class moodle1_info_handler extends moodle1_handler {
* Stashes the backup info for later processing by {@link moodle1_root_handler}
*/
public function on_info_details_mod_end($data) {
$this->converter->set_stash('modinfo_'.$this->currentmod['name'], $this->currentmod);
$this->modnames[] = $this->currentmod['name'];
global $CFG;
// keep only such modules that seem to have the support for moodle1 implemented
$modname = $this->currentmod['name'];
if (file_exists($CFG->dirroot.'/mod/'.$modname.'/backup/moodle1/lib.php')) {
$this->converter->set_stash('modinfo_'.$modname, $this->currentmod);
$this->modnames[] = $modname;
}
$this->currentmod = array();
}