Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-31807 fix invalid nulls in cohort components

Credit goes to Stephen.
  • Loading branch information...
commit 0908a1a327b67ee6b3a3e4fb303b24cbb4a61128 1 parent e356fb6
@skodak skodak authored
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 0908a1a

Please sign in to comment.
Something went wrong with that request. Please try again.