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_FormBuilder » Bug #7167

PostgreSQL boolean values rendering problem

Details

Submitted2006-03-21 00:14 UTC
Fromvshivak at php dot net
Assignedjustinpatrin
StatusClosed
PackageDB_DataObject_FormBuilder
PHP VersionIrrelevant
OSIrrelevant
Roadmaps(Not assigned)

Comments

[2006-03-21 00:14 UTC] vshivak at php dot net

Description:
------------
With PostgreSQL, boolean fields have 'f', or 't', not 1, or 0 as values.

When rendering checkbox for booleans in FormBuilder you expect input value 1, or 0, but from PostgreSQL comes f/t.

Fix is fairly easy. Following should go after line 1141 of FormBuilder.php (1.0.0RC4):
('f' === $formValues[$key]) ? $formValues[$key] = 0 : $formValues[$key] = 1;

Actually, Bug #4904 (http://pear.php.net/bugs/bug.php?id=4904) talks about this issue, but it is wrongly assigned to DB_DataObject, not to FormBuilder.