]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-18567:
authorthepurpleblob <thepurpleblob>
Mon, 16 Mar 2009 16:37:31 +0000 (16:37 +0000)
committerthepurpleblob <thepurpleblob>
Mon, 16 Mar 2009 16:37:31 +0000 (16:37 +0000)
Check for (boolean) false coming back from database instead of real data

Merged from STABLE_19

mod/data/lib.php

index a5ccd253b7ee63c3b9ce5bcfd0a3d73e49852392..d1d57c580132864c0c30b5206859f5e1e8ec8885 100755 (executable)
@@ -193,6 +193,11 @@ class data_field_base {     // Base class for Database Field Types (see field/*/
             $content = '';
         }
 
+        // beware get_field returns false for new, empty records MDL-18567
+        if ($content===false) {
+            $content='';
+        }
+
         $str = '<div title="'.s($this->field->description).'">';
         $str .= '<input style="width:300px;" type="text" name="field_'.$this->field->id.'" id="field_'.$this->field->id.'" value="'.s($content).'" />';
         $str .= '</div>';