Merge branch 'w10_MDL-31807_m22_cohort' of git://github.com/skodak/moodle into MOODLE_22_STABLE

This commit is contained in:
Sam Hemelryk
2012-03-05 16:56:05 +13:00
+3 -2
View File
@@ -71,8 +71,9 @@ function cohort_add_cohort($cohort) {
*/
function cohort_update_cohort($cohort) {
global $DB;
if (isset($cohort->component) and empty($cohort->component)) {
$cohort->component = NULL;
if (property_exists($cohort, 'component') and empty($cohort->component)) {
// prevent NULLs
$cohort->component = '';
}
$cohort->timemodified = time();
$DB->update_record('cohort', $cohort);