]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16075 File storage conversion of Glossary
authorskodak <skodak>
Sun, 17 Aug 2008 21:38:47 +0000 (21:38 +0000)
committerskodak <skodak>
Sun, 17 Aug 2008 21:38:47 +0000 (21:38 +0000)
mod/glossary/db/upgrade.php

index 270c2cd337f22b199e5f5cda26133d7031e2a26d..4abeee0cef60eac2ab68328eaabce7af09c5d3f3 100644 (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;