MDL-53402 mod_data: field values of 0 are now displayed.
authorAdrian Greeve <adrian@moodle.com>
Tue, 3 May 2016 06:22:16 +0000 (14:22 +0800)
committerAdrian Greeve <adrian@moodle.com>
Tue, 3 May 2016 06:22:16 +0000 (14:22 +0800)
mod/data/field/checkbox/field.class.php
mod/data/field/multimenu/field.class.php

index fd48690..c1b60a8 100644 (file)
@@ -177,7 +177,7 @@ class data_field_checkbox extends data_field_base {
         global $DB;
 
         if ($content = $DB->get_record('data_content', array('fieldid'=>$this->field->id, 'recordid'=>$recordid))) {
-            if (empty($content->content)) {
+            if (strval($content->content) === '') {
                 return false;
             }
 
index 986b0d2..34beb47 100644 (file)
@@ -235,7 +235,7 @@ class data_field_multimenu extends data_field_base {
         global $DB;
 
         if ($content = $DB->get_record('data_content', array('fieldid'=>$this->field->id, 'recordid'=>$recordid))) {
-            if (empty($content->content)) {
+            if (strval($content->content) === '') {
                 return false;
             }