Browse files

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

…odle into MOODLE_21_STABLE
  • Loading branch information...
2 parents c7b2347 + 1cb9ca1 commit b3e2eb804a27b9d8ab14430b4dcad5aad7fb5540 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 b3e2eb8

Please sign in to comment.