Index: /branches/release-41/php/lib/mtdb_base.php
===================================================================
--- /branches/release-41/php/lib/mtdb_base.php (revision 2658)
+++ /branches/release-41/php/lib/mtdb_base.php (revision 2665)
@@ -3076,7 +3076,5 @@
                 foreach ($cfrow as $cffield => $cfvalue) {
                     if (preg_match("/^${field_prefix}v/", $cffield)) {
-                        // FIXME: Some DBMS can't distinguish NULL from empty string.
-                        // Treat custom field that has empty string the same as field with no data.
-                        if (isset($cfvalue) && $cfvalue) {
+                        if (isset($cfvalue) && ( $cfvalue != '' )) {
                             $value = $cfvalue;
                             $field = $cffield;
@@ -3085,5 +3083,5 @@
                     }
                 }
-                if (isset($value)) {
+                if (isset($field)) {
                     if (preg_match("/_vblob$/", $field)) {
                         # unserialize blob if value is serialized
@@ -3095,6 +3093,6 @@
                         }
                     }
-                    $meta[$cfrow["${datasource}_meta_type"]] = $value;
-                }
+                }
+                $meta[$cfrow["${datasource}_meta_type"]] = $value;
             }
             $this->_meta_cache["${obj_type}_meta_${obj_id}"] = $meta;
