Merge branch 'w10_MDL-31807_m23_cohort' of git://github.com/skodak/moodle

This commit is contained in:
Sam Hemelryk 2012-03-05 16:56:30 +13:00
commit 0d4f9805ef

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);