Changeset 2665

Show
Ignore:
Timestamp:
07/01/08 03:45:24 (12 months ago)
Author:
fumiakiy
Message:

Allow '0' as valid value for meta fields. BugId:80349

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-41/php/lib/mtdb_base.php

    r2658 r2665  
    30763076                foreach ($cfrow as $cffield => $cfvalue) { 
    30773077                    if (preg_match("/^${field_prefix}v/", $cffield)) { 
    3078                         // FIXME: Some DBMS can't distinguish NULL from empty string. 
    3079                         // Treat custom field that has empty string the same as field with no data. 
    3080                         if (isset($cfvalue) && $cfvalue) { 
     3078                        if (isset($cfvalue) && ( $cfvalue != '' )) { 
    30813079                            $value = $cfvalue; 
    30823080                            $field = $cffield; 
     
    30853083                    } 
    30863084                } 
    3087                 if (isset($value)) { 
     3085                if (isset($field)) { 
    30883086                    if (preg_match("/_vblob$/", $field)) { 
    30893087                        # unserialize blob if value is serialized 
     
    30953093                        } 
    30963094                    } 
    3097                     $meta[$cfrow["${datasource}_meta_type"]] = $value; 
    3098                 } 
     3095                } 
     3096                $meta[$cfrow["${datasource}_meta_type"]] = $value; 
    30993097            } 
    31003098            $this->_meta_cache["${obj_type}_meta_${obj_id}"] = $meta;