PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB_DataObject » Bug #4904

boolean issue - in combination with DB_DataObject_Formbuilder

Details

Request #4904boolean issue - in combination with DB_DataObject_Formbuilder
Submitted2005-07-24 19:04 UTC
Fromjoost at deetman dot nl
StatusWont fix
PackageDB_DataObject
PHP Version4.3.10
OSPostgreSQL
Roadmaps(Not assigned)

Comments

[2005-07-24 19:04 UTC] joost at deetman dot nl

Description:
------------
When data is fetched out of a postgreSQL-database, boolean values are difined as 't' or 'f'. For nomal operations you can live with it, however for FormBuilder, you need '0' or '1' values. Otherwise, FormBuilder won't work.

Maybe it can be fixed when the data is fetch'ed, but I'm not sure it's useful for everyone.

http://cvs.php.net/co.php/pear/DB_DataObject/DataObject.php?r=1.365
Line: 545

< $this->$kk = $array[$k];
---------------------------------------
> if ($items[$kk] & DB_DATAOBJECT_BOOL && (is_null($array[$k]) || $array[$k] == 'f')) {
> $this->$kk = '0';
> } elseif ($items[$kk] & DB_DATAOBJECT_BOOL) {
> $this->$kk = '1';
> } else {
> $this->$kk = $array[$k];
> }

You also have to delcare $items, on Line 538.

> $items = isset($_DB_DATAOBJECT['INI'][$this->_database][$this->__table]) ?
> $_DB_DATAOBJECT['INI'][$this->_database][$this->__table] : $this->table();