From 0d18a9d6d75bb711eaa3ca9ab6931fcb29d44013 Mon Sep 17 00:00:00 2001 From: skodak Date: Sun, 17 Aug 2008 21:38:47 +0000 Subject: [PATCH] MDL-16075 File storage conversion of Glossary --- mod/glossary/db/upgrade.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mod/glossary/db/upgrade.php b/mod/glossary/db/upgrade.php index 270c2cd337..4abeee0cef 100644 --- a/mod/glossary/db/upgrade.php +++ b/mod/glossary/db/upgrade.php @@ -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; -- 2.39.5