MDL-18227 forum ratings - clean wrong records; merged from 19_STABLE
authorstronk7 <stronk7>
Mon, 4 May 2009 08:44:51 +0000 (08:44 +0000)
committerstronk7 <stronk7>
Mon, 4 May 2009 08:44:51 +0000 (08:44 +0000)
mod/forum/db/upgrade.php
mod/forum/version.php

index 7bbbca9f099b7dead1ce51d49c4e3aa952c7d24f..a7555b2512748a64c0291924d82a07b8f0b668d4 100644 (file)
@@ -255,6 +255,15 @@ function xmldb_forum_upgrade($oldversion) {
         upgrade_mod_savepoint($result, 2009042700, 'forum');
     }
 
+    if ($result && $oldversion < 2009050400) {
+
+    /// Clean existing wrong rates. MDL-18227
+        $DB->delete_records('forum_ratings', array('post' => 0));
+
+    /// forum savepoint reached
+        upgrade_mod_savepoint($result, 2009050400, 'forum');
+    }
+
     return $result;
 }
 
index 20aab4ba68326981ad01bc541160dadc621764ca..a11bd8a2b64a6174c87dc79de865e4ff1614512d 100644 (file)
@@ -5,7 +5,7 @@
 //  This fragment is called by /admin/index.php
 ////////////////////////////////////////////////////////////////////////////////
 
-$module->version  = 2009042700;
+$module->version  = 2009050400;
 $module->requires = 2009041700;  // Requires this Moodle version
 $module->cron     = 60;