]> git.mjollnir.org Git - moodle.git/commitdiff
Upgraded glossary to 2004051400. The process will launch an
authorstronk7 <stronk7>
Fri, 14 May 2004 19:14:57 +0000 (19:14 +0000)
committerstronk7 <stronk7>
Fri, 14 May 2004 19:14:57 +0000 (19:14 +0000)
update of entry->concept and alias->alias to trim them.
This should close bug 985 forever...
(http://moodle.org/bugs/bug.php?op=show&bugid=985)

mod/glossary/db/mysql.php
mod/glossary/db/postgres7.php
mod/glossary/edit.php
mod/glossary/version.php

index 00eaeabb0611d7e1206dc18ec0f166a423954c65..f23ba6ae09f43ad3da88828b76b86b2f8ac388fb 100644 (file)
@@ -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.<p>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;
 }
index 76974f0ac5a167076312fd69bcc95d19a06b91da..eef62fda5bba8477f884fa29af924ad2bf85ad59 100644 (file)
@@ -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.<p>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;
 }
 
index a11facd1f52a6ce245644519a84d77c965a6d428..38a2030d1c79d893a8441626708cf964494d10e0 100644 (file)
@@ -121,7 +121,6 @@ if ( $confirm ) {
         }
     } else {
 
-echo "Creating!!!!!";
         $newentry->userid = $USER->id;
         $newentry->timecreated = $timenow;
         $newentry->sourceglossaryid = 0;
index 9d48af27e153f433381e0f4f92592e61dc447a75..44a1ac8702c1b483c6240a15dd21631c05c20403 100644 (file)
@@ -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)