]> git.mjollnir.org Git - moodle.git/commitdiff
dmlib: set_field() now has the Oracle DIRTY HACK too!
authormartinlanghoff <martinlanghoff>
Tue, 26 Sep 2006 05:10:39 +0000 (05:10 +0000)
committermartinlanghoff <martinlanghoff>
Tue, 26 Sep 2006 05:10:39 +0000 (05:10 +0000)
lib/dmllib.php

index 3c30c4501314a5d259251d57482600df76c78bb8..5bb91c4171da998ea4bf6c40fe6d81ee3f48692e 100644 (file)
@@ -962,6 +962,15 @@ function set_field($table, $newfield, $newvalue, $field1, $value1, $field2='', $
 
     $select = where_clause($field1, $value1, $field2, $value2, $field3, $value3);
 
+    // Oracle DIRTY HACK - 
+    if ($CFG->dbtype == 'oci8po') {
+        $dataobject = new StdClass;
+        $dataobject->{$newfield} = $newvalue;
+        oracle_dirty_hack($table, $dataobject); // Convert object to the correct "empty" values for Oracle DB
+        $newvalue = $dataobject->{$newfield};
+    }
+    /// End DIRTY HACK
+
     return $db->Execute('UPDATE '. $CFG->prefix . $table .' SET '. $newfield  .' = \''. $newvalue .'\' '. $select);
 }