Permalink
Browse files

Merge branch 'w10_MDL-31807_m22_cohort' of git://github.com/skodak/mo…

…odle into MOODLE_22_STABLE
  • Loading branch information...
2 parents 94cfcb3 + 0908a1a commit 7d6c1a19bbdbe90deec1b033bdfc230d0568f33e Sam Hemelryk committed Mar 5, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 cohort/lib.php
View
5 cohort/lib.php
@@ -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);

0 comments on commit 7d6c1a1

Please sign in to comment.