diff --git a/mod/glossary/db/mysql.php b/mod/glossary/db/mysql.php index 00eaeabb061..f23ba6ae09f 100644 --- a/mod/glossary/db/mysql.php +++ b/mod/glossary/db/mysql.php @@ -255,6 +255,21 @@ function glossary_upgrade($oldversion) { table_column("glossary","","rssarticles","tinyint","2", "unsigned", "0", "", "rsstype"); set_config("glossary_enablerssfeeds",0); } + + + if ( $oldversion < 2004051400 ) { + print_simple_box("This update might take several seconds.

The more glossaries, entries and aliases you have created, the more it will take so please be patient.","center", "50%", "$THEME->cellheading", "20", "noticebox"); + if ( $entries = get_records("glossary_entries")) { + foreach($entries as $entry) { + set_field("glossary_entries","concept",addslashes(trim($entry->concept)),"id",$entry->id); + } + } + if ( $aliases = get_records("glossary_alias")) { + foreach($aliases as $alias) { + set_field("glossary_alias","alias",addslashes(trim($alias->alias)),"id",$alias->id); + } + } + } return true; } diff --git a/mod/glossary/db/postgres7.php b/mod/glossary/db/postgres7.php index 76974f0ac5a..eef62fda5bb 100644 --- a/mod/glossary/db/postgres7.php +++ b/mod/glossary/db/postgres7.php @@ -19,6 +19,20 @@ function glossary_upgrade($oldversion) { set_config("glossary_enablerssfeeds",0); } + if ( $oldversion < 2004051400 ) { + print_simple_box("This update might take several seconds.

The more glossaries, entries and aliases you have created, the more it will take so please be patient.","center", "50%", "$THEME->cellheading", "20", "noticebox"); + if ( $entries = get_records("glossary_entries")) { + foreach($entries as $entry) { + set_field("glossary_entries","concept",addslashes(trim($entry->concept)),"id",$entry->id); + } + } + if ( $aliases = get_records("glossary_alias")) { + foreach($aliases as $alias) { + set_field("glossary_alias","alias",addslashes(trim($alias->alias)),"id",$alias->id); + } + } + } + return true; } diff --git a/mod/glossary/edit.php b/mod/glossary/edit.php index a11facd1f52..38a2030d1c7 100644 --- a/mod/glossary/edit.php +++ b/mod/glossary/edit.php @@ -121,7 +121,6 @@ if ( $confirm ) { } } else { -echo "Creating!!!!!"; $newentry->userid = $USER->id; $newentry->timecreated = $timenow; $newentry->sourceglossaryid = 0; diff --git a/mod/glossary/version.php b/mod/glossary/version.php index 9d48af27e15..44a1ac8702c 100644 --- a/mod/glossary/version.php +++ b/mod/glossary/version.php @@ -5,7 +5,7 @@ /// This fragment is called by moodle_needs_upgrading() and /admin/index.php ///////////////////////////////////////////////////////////////////////////////// -$module->version = 2004050900; // The current module version (Date: YYYYMMDDXX) +$module->version = 2004051400; // The current module version (Date: YYYYMMDDXX) $module->requires = 2004050300; // Requires this Moodle version $module->cron = 0; // Period for cron to check this module (secs)