MDL-16075 File storage conversion of Glossary

This commit is contained in:
skodak
2008-08-17 21:38:47 +00:00
parent 49bcd7372b
commit 0d18a9d6d7
+2 -3
View File
@@ -60,15 +60,14 @@ function xmldb_glossary_upgrade($oldversion) {
$pbar->update($i, $count, "Migrating glossary entries - $i/$count.");
$filepath = "$CFG->dataroot/$entry->course/$CFG->moddata/glossary/$entry->glossaryid/$entry->id/$entry->attachment";
if (!is_readable($filepath)) {
if ($entry->sourceglossaryid and !is_readable($filepath)) {
//eh - try the second possible location
$filepath2 = $filepath;
$filepath = "$CFG->dataroot/$entry->course/$CFG->moddata/glossary/$entry->sourceglossaryid/$entry->id/$entry->attachment";
}
if (!is_readable($filepath)) {
//file missing??
notify("File not readable, skipping: $filepath2 and $filepath");
notify("File not readable, skipping: $filepath");
$entry->attachment = '';
$DB->update_record('glossary_entries', $entry);
continue;