Skip to content

Commit

Permalink
Merge branch 'w10_MDL-31807_m20_cohort' of git://github.com/skodak/mo…
Browse files Browse the repository at this point in the history
…odle into MOODLE_20_STABLE
  • Loading branch information
Sam Hemelryk committed Mar 5, 2012
2 parents c4e4b6a + 2ff7800 commit da27633
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cohort/lib.php
Expand Up @@ -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);
Expand Down

0 comments on commit da27633

Please sign in to comment.