Index: pdo_moodle_database.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/dml/pdo_moodle_database.php,v retrieving revision 1.8 diff -u -r1.8 pdo_moodle_database.php --- pdo_moodle_database.php 13 Jul 2008 20:28:08 -0000 1.8 +++ pdo_moodle_database.php 24 Jul 2008 21:57:30 -0000 @@ -395,9 +395,14 @@ $value = (int)$value; // prevent "false" problems } if (!empty($column->enums)) { - if (!in_array((string)$value, $column->enums)) { - debugging('Enum value '.s($value).' not allowed in field '.$field.' table '.$table.'.'); - return false; + // workaround for problem with wrong enums in mysql + if (is_null($value) and !$column->not_null) { + // ok - nulls allowed + } else { + if (!in_array((string)$value, $column->enums)) { + debugging('Enum value '.s($value).' not allowed in field '.$field.' table '.$table.'.'); + return false; + } } } $cleaned[$field] = $value;