data MDL-24619 fixed a bug that made importing a preset database unlikely to work

This commit is contained in:
Andrew Davis
2010-10-18 08:45:45 +00:00
parent d997cc88cb
commit 720f37fdc2
+5 -1
View File
@@ -2053,12 +2053,16 @@ abstract class data_preset_importer {
$fs = get_file_storage();
$files = $fs->get_area_files(DATA_PRESET_CONTEXT, DATA_PRESET_COMPONENT, DATA_PRESET_FILEAREA);
//preset name to find will be the final element of the directory
$presettofind = end(explode('/',$this->directory));
//now go through the available files available and see if we can find it
foreach ($files as $file) {
if (($file->is_directory() && $file->get_filepath()=='/') || !$file->is_directory()) {
continue;
}
$presetname = trim($file->get_filepath(), '/');
if ($presetname==$this->module->name) {
if ($presetname==$presettofind) {
$this->directory = $presetname;
$fileobj = $file;
}